congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
SIComposite.findNearest
Code IndexAdd Tabnine to your IDE (free)

How to use
findNearest
method
in
org.opensingular.form.SIComposite

Best Java code snippets using org.opensingular.form.SIComposite.findNearest (Showing top 12 results out of 315)

origin: org.opensingular/singular-server-commons

private void columnValidation(InstanceValidatable<SIComposite> validatable) {
  Optional<SIBoolean> databaseFieldInstance  = validatable.getInstance().findNearest(foundDataBase);
  Optional<SIBoolean> hibernateFieldInstance = validatable.getInstance().findNearest(foundHibernate);
  // Encontrado no hibernate e nao no banco
  if (hibernateFieldInstance.isPresent()
      && hibernateFieldInstance.get().getValue()
      && databaseFieldInstance.isPresent()
      && !databaseFieldInstance.get().getValue()) {
    validatable.error("Inconsistency between database and Hibernate!");
  }
  else {
    // Encontrado no banco e nao no hibernate
    Optional<SIBoolean>        nullableFieldInstance = validatable.getInstance().findNearest(nullable);
    Optional<SIList<SIString>> listObj               = validatable.getInstance().findNearest(userPrivs);
    List<Object>               listPrivs             = listObj.map(SIList::getValue).orElse(Collections.emptyList());
    List<String>               vals                  = new ArrayList<>();
    listPrivs.forEach(obj -> vals.add((String) obj));
    if (nullableFieldInstance.isPresent() && !nullableFieldInstance.get().getValue() && (!vals.contains("INSERT") || !vals.contains("UPDATE"))) {
      validatable.error("Column NOT NULL without SELECT or UPDATE permissions");
    }
  }
}
origin: org.opensingular/singular-requirement-commons

private void columnValidation(InstanceValidatable<SIComposite> validatable) {
  Optional<SIBoolean> databaseFieldInstance  = validatable.getInstance().findNearest(foundDataBase);
  Optional<SIBoolean> hibernateFieldInstance = validatable.getInstance().findNearest(foundHibernate);
  // Encontrado no hibernate e nao no banco
  if (hibernateFieldInstance.isPresent()
      && hibernateFieldInstance.get().getValue()
      && databaseFieldInstance.isPresent()
      && !databaseFieldInstance.get().getValue()) {
    validatable.error("Inconsistency between database and Hibernate!");
  }
  else {
    // Encontrado no banco e nao no hibernate
    Optional<SIBoolean>        nullableFieldInstance = validatable.getInstance().findNearest(nullable);
    Optional<SIList<SIString>> listObj               = validatable.getInstance().findNearest(userPrivs);
    List<Object>               listPrivs             = listObj.map(SIList::getValue).orElse(Collections.emptyList());
    List<String>               vals                  = new ArrayList<>();
    listPrivs.forEach(obj -> vals.add((String) obj));
    if (nullableFieldInstance.isPresent() && !nullableFieldInstance.get().getValue() && (!vals.contains("INSERT") || !vals.contains("UPDATE"))) {
      validatable.error("Column NOT NULL without SELECT or UPDATE permissions");
    }
  }
}
origin: org.opensingular/singular-server-commons

  private void tableValidation(InstanceValidatable<SIComposite> validatable) {

    Optional<SIBoolean> foundTableInstance = validatable.getInstance().findNearest(found);
    if (!foundTableInstance.isPresent() || !foundTableInstance.get().getValue()) {
      validatable.error("Table not found!");
    }

    Optional<SIString>         foundSchemaField = validatable.getInstance().findNearest(schema);
    Optional<SIList<SIString>> listObj          = validatable.getInstance().findNearest(userPrivs);
    List<Object>               listPrivs        = listObj.map(SIList::getValue).orElse(Collections.emptyList());
    List<String>               vals             = new ArrayList<>();
    listPrivs.forEach(obj -> vals.add((String) obj));

    if (foundSchemaField.isPresent()) {
      SIString foundSchemaFieldInstance = foundSchemaField.get();
      if (SqlUtil.isSingularSchema(foundSchemaFieldInstance.getValue())
          && SqlUtil.hasCompleteCrud(vals)) {
        validatable.error("Singular table without complete CRUD!");
      }
    }

  }
}
origin: org.opensingular/singular-requirement-module

private void columnValidation(InstanceValidatable<SIComposite> validatable) {
  Optional<SIBoolean> databaseFieldInstance  = validatable.getInstance().findNearest(foundDataBase);
  Optional<SIBoolean> hibernateFieldInstance = validatable.getInstance().findNearest(foundHibernate);
  // Encontrado no hibernate e nao no banco
  if (hibernateFieldInstance.isPresent()
      && hibernateFieldInstance.get().getValue()
      && databaseFieldInstance.isPresent()
      && !databaseFieldInstance.get().getValue()) {
    validatable.error("Inconsistency between database and Hibernate!");
  }
  else {
    // Encontrado no banco e nao no hibernate
    Optional<SIBoolean>        nullableFieldInstance = validatable.getInstance().findNearest(nullable);
    Optional<SIList<SIString>> listObj               = validatable.getInstance().findNearest(userPrivs);
    List<Object>               listPrivs             = listObj.map(SIList::getValue).orElse(Collections.emptyList());
    List<String>               vals                  = new ArrayList<>();
    listPrivs.forEach(obj -> vals.add((String) obj));
    if (nullableFieldInstance.isPresent() && !nullableFieldInstance.get().getValue() && (!vals.contains("INSERT") || !vals.contains("UPDATE"))) {
      validatable.error("Column NOT NULL without SELECT or UPDATE permissions");
    }
  }
}
origin: org.opensingular/singular-requirement-commons

  private void tableValidation(InstanceValidatable<SIComposite> validatable) {

    Optional<SIBoolean> foundTableInstance = validatable.getInstance().findNearest(found);
    if (!foundTableInstance.isPresent() || !foundTableInstance.get().getValue()) {
      validatable.error("Table not found!");
    }

    Optional<SIString>         foundSchemaField = validatable.getInstance().findNearest(schema);
    Optional<SIList<SIString>> listObj          = validatable.getInstance().findNearest(userPrivs);
    List<Object>               listPrivs        = listObj.map(SIList::getValue).orElse(Collections.emptyList());
    List<String>               vals             = new ArrayList<>();
    listPrivs.forEach(obj -> vals.add((String) obj));

    if (foundSchemaField.isPresent()) {
      SIString foundSchemaFieldInstance = foundSchemaField.get();
      if (SqlUtil.isSingularSchema(foundSchemaFieldInstance.getValue())
          && SqlUtil.hasCompleteCrud(vals)) {
        validatable.error("Singular table without complete CRUD!");
      }
    }

  }
}
origin: org.opensingular/singular-requirement-module

  private void tableValidation(InstanceValidatable<SIComposite> validatable) {

    Optional<SIBoolean> foundTableInstance = validatable.getInstance().findNearest(found);
    if (!foundTableInstance.isPresent() || !foundTableInstance.get().getValue()) {
      validatable.error("Table not found!");
    }

    Optional<SIString>         foundSchemaField = validatable.getInstance().findNearest(schema);
    Optional<SIList<SIString>> listObj          = validatable.getInstance().findNearest(userPrivs);
    List<Object>               listPrivs        = listObj.map(SIList::getValue).orElse(Collections.emptyList());
    List<String>               vals             = new ArrayList<>();
    listPrivs.forEach(obj -> vals.add((String) obj));

    if (foundSchemaField.isPresent()) {
      SIString foundSchemaFieldInstance = foundSchemaField.get();
      if (SqlUtil.isSingularSchema(foundSchemaFieldInstance.getValue())
          && SqlUtil.hasCompleteCrud(vals)) {
        validatable.error("Singular table without complete CRUD!");
      }
    }

  }
}
origin: org.opensingular/exemplos-form

final Optional<SIList<SIComposite>> lista = ins.findNearest(demonstrativos);
for (int i = 0; i < 5; i++) {
  final SIComposite siComposite = lista.get().addNew();
  siComposite.findNearest(ano).get().setValue(LocalDate.now().getYear() + i);
  final SIList<SIComposite> receitas_ = siComposite.findNearest(receitas).get();
  final SIList<SIComposite> despesas_ = siComposite.findNearest(despesas).get();
  TIPOS_RECEITA.stream().forEach(tipo -> receitas_.addNew().setValue("tipo", tipo));
  TIPOS_DESPESA.stream().forEach(tipo -> despesas_.addNew().setValue("tipo", tipo));
origin: org.opensingular/singular-form-samples

final Optional<SIList<SIComposite>> lista = ins.findNearest(demonstrativos);
for (int i = 0; i < 5; i++) {
  final SIComposite siComposite = lista.get().addNew();
  siComposite.findNearest(ano).get().setValue(LocalDate.now().getYear() + i);
  final SIList<SIComposite> receitas_ = siComposite.findNearest(receitas).get();
  final SIList<SIComposite> despesas_ = siComposite.findNearest(despesas).get();
  TIPOS_RECEITA.stream().forEach(tipo -> receitas_.addNew().setValue("tipo", tipo));
  TIPOS_DESPESA.stream().forEach(tipo -> despesas_.addNew().setValue("tipo", tipo));
origin: org.opensingular/singular-p-server-commons

Optional<SIBoolean> foundTableInstance = validatable.getInstance().findNearest(foundTableField);
if (!foundTableInstance.isPresent() || !foundTableInstance.get().getValue()) {
  validatable.error("Table not found!");
Optional<SIString> foundSchemaField = validatable.getInstance().findNearest(schemaField);
Optional<SIList<SIString>> listObj = validatable.getInstance().findNearest(privs);
List<Object> listPrivs = listObj.get().getValue();
List<String> vals = new ArrayList<>();
Optional<SIBoolean> databaseFieldInstance = validatable.getInstance().findNearest(foundDatabaseField);
Optional<SIBoolean> hibernateFieldInstance = validatable.getInstance().findNearest(foundHibernateField);
}else{
  Optional<SIBoolean> nullableFieldInstance = validatable.getInstance().findNearest(nullableField);
  Optional<SIList<SIString>> listObj = validatable.getInstance().findNearest(privs);
  List<Object> listPrivs = listObj.get().getValue();
  List<String> vals = new ArrayList<>();
origin: org.opensingular/exemplos-form

Integer       idDescricao = validatable.getInstance().findNearest(descricaoDinamizada).get().findNearest(idDescricaoDinamizada).get().getValue();
final Integer value       = validatable.getInstance().getValue();
final Triple  t           = dominioService(validatable.getInstance()).diluicao(idDescricao);
origin: org.opensingular/exemplos-form

ins.findNearest(empresaPropria.razaoSocial).ifPresent(ins2 -> ins2.setValue("Empresa de teste"));
ins.findNearest(empresaPropria.cnpj).ifPresent(ins2 -> ins2.setValue("11111111000191"));
ins.findNearest(empresaPropria.endereco).ifPresent(ins2 -> ins2.setValue("SCLN 211 BLOCO B SUBSOLO"));
origin: org.opensingular/exemplos-form

Integer          idNomenclatura = validatable.getInstance().findNearest(nomenclaturaBotanica).get().findNearest(idNomenclaturaBotanica).get().getValue();
final BigDecimal value          = validatable.getInstance().getValue();
final Optional<SIList<SIComposite>> lista = ins.findNearest(ensaios);
  siComposite.findNearest(ensaio.idTipoEnsaio).get().setValue(tipoEnsaioControleQualidade.getId());
  siComposite.findNearest(ensaio.descricaoTipoEnsaio).get().setValue(tipoEnsaioControleQualidade.getDescricao());
org.opensingular.formSICompositefindNearest

Popular methods of SIComposite

  • getField
  • getFields
    List only those fields already instantiated. OBS: field instantiation occurs automatically when its
  • getType
  • getDocument
  • setValue
  • asAtr
  • findDescendant
  • getFieldList
  • asAtrAnnotation
  • asAtrBootstrap
  • clearInstance
  • createField
  • clearInstance,
  • createField,
  • findFieldIndex,
  • findFieldIndexOpt,
  • getAllChildren,
  • getAllFields,
  • getDictionary,
  • getFieldLocalWithoutCreating,
  • getFieldOpt

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getSharedPreferences (Context)
  • findViewById (Activity)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • PhpStorm for WordPress
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now