Tabnine Logo
Column.getId
Code IndexAdd Tabnine to your IDE (free)

How to use
getId
method
in
com.speedment.runtime.config.Column

Best Java code snippets using com.speedment.runtime.config.Column.getId (Showing top 20 results out of 315)

origin: speedment/speedment

@Override
public String getDescription() {
  return "The referenced element " + col.getId()
    + ", is not enabled. Disabled elements will "
    + "not be generated. Thus, referencing a disabled element "
    + "will result in broken code.\n"
    + "This might be a result of the element in question not being enabled, "
    + "or that an ancestor of the element is not enabled. \n"
    + "To fix this issue, make sure the element " + targetName + " is enabled.";
}
origin: speedment/speedment

@Override
public String getTitle() {
  return "Reference not enabled: " + col.getId();
}
origin: speedment/speedment

/**
 * Locate the {@link Column} child with the specified id if it exists, else
 * return an empty {@code Optional}.
 *
 * @param id  the {@link HasId#getId()} of the column
 * @return    the child found or an empty {@code Optional}
 */
default Optional<? extends Column> findColumn(String id) {
  return columns().filter(child -> child.getId().equals(id)).findAny();
}
origin: speedment/speedment

public static Optional<? extends Column> referencedColumnIfPresent(Project project, String dbmsId, String schemaId, String tableId, String columnId) {
  return referencedTableIfPresent(project, dbmsId, schemaId, tableId)
    .flatMap(table -> table.columns().filter(column -> columnId.equals(column.getId()))
      .findAny()
    );
}

origin: speedment/speedment

@Override
public Persister<ENTITY> persister(HasLabelSet<ENTITY> includedFields) {
  Predicate<Column> columns = insertColumnFilter.and(c -> includedFields.test(c.getId()));
  String statement = getInsertStatement(updateColumnFilter.and(c12 -> includedFields.test(c12.getId())));
  return entity -> persist(entity, f -> columns.test(columnsByFields.get(f)), statement);
}
origin: speedment/speedment

@Override
public Updater<ENTITY> updater(HasLabelSet<ENTITY> includedFields) {
  assertHasPrimaryKeyColumns();
  Predicate<Column> columns = updateColumnFilter.and(c -> includedFields.test(c.getId()));
  String statement = getUpdateStatement(updateColumnFilter.and(c12 -> includedFields.test(c12.getId())));
  return entity -> update(entity, f -> columns.test(columnsByFields.get(f)), statement);
}
origin: speedment/speedment

/**
 * A helper method for accessing the foreign {@link Column} referenced by
 * this key.
 *
 * @return the foreign {@link Column} referenced by this
 */
default Optional<? extends Column> findForeignColumn() {
  return findForeignTable()
    .flatMap(table -> table.columns()
      .filter(col -> col.getId().equals(getForeignColumnName()))
      .findAny()
    );
}
origin: speedment/speedment

/**
 * Returns {@code true} if the two specified documents represents the same
 * element in the database. Two documents are considered same if they have
 * the same name and type and their parents are considered same.
 * 
 * @param first   the first document
 * @param second  the second document
 * @return        {@code true} if same, else {@code false}
 */
public static boolean isSame(Column first, Column second) {
  if (first.getId().equals(second.getId())) {
    final Table firstParent  = first.getParentOrThrow();
    final Table secondParent = second.getParentOrThrow();
    return isSame(firstParent, secondParent);
  } else {
    return false;
  }
}

origin: speedment/speedment

/**
 * Locates and returns the column referenced by the {@link #getId()} 
 * method.
 * 
 * @return  the referenced column
 */
default Optional<? extends Column> findColumn() {
  return ancestors()
    .filter(Table.class::isInstance)
    .map(Table.class::cast)
    .findFirst()
    .flatMap(table -> table
      .columns()
      .filter(col -> col.getId().equals(getId()))
      .findAny()
    );
}

origin: speedment/speedment

/**
 * Returns a list of all the enum constants in a particular column.
 * The list is created each time this method is called and is therefore
 * safe to edit without affecting the column.
 * <p>
 * If no enum constants was specified in the column, an exception is
 * thrown.
 * 
 * @param column  the column to retreive the constants from
 * @return        list of the constants
 */
public static List<String> enumConstantsOf(Column column) {
  return Stream.of(column.getEnumConstants()
    .orElseThrow(() -> new RuntimeException(
      "Column '" + column.getId() + 
      "' in table '" + column.getParentOrThrow().getId() + 
      "' was marked as an enum but no enum constants was specified."
    ))
    .split(",")
  ).sorted().collect(toList());
}
origin: speedment/speedment

private static int findNullOffset(
  final Table table,
  final Stage<?> stage,
  final HasComparableOperators<?, ?> field
) {
  int result = -1;
  final String onColumnId = field
    .identifier()
    .getColumnId();
  final List<Column> columns = table.columns()
    .filter(Column::isEnabled)
    .collect(toList());
  for (int j = 0; j < columns.size(); j++) {
    final String columnId = columns.get(j).getId();
    if (columnId.equals(onColumnId)) {
      // Compose a null detecting entity mapper
      result = j;
      break;
    }
  }
  if (result == -1) {
    throw new IllegalStateException(
      "Unable to locate column " + onColumnId + " in table " + table.getId()
      + " for stage " + stage.toString()
      + " Columns: " + columns.stream().map(Column::getId).collect(joining(", "))
    );
  }
  return result;
}
origin: speedment/speedment

private SqlPersistenceImpl(SqlPersistenceImpl<ENTITY> template, HasLabelSet<ENTITY> includedFields) {
  primaryKeyFields = template.primaryKeyFields;
  fields = template.fields;
  dbms = template.dbms;
  table = template.table;
  dbmsType = template.dbmsType;
  sqlTableReference = template.sqlTableReference;
  hasPrimaryKeyColumns = template.hasPrimaryKeyColumns;
  naming = template.naming;
  operationHandler = template.operationHandler;
  columnHandler = template.columnHandler;
  entityClass = template.entityClass;
  this.insertColumnFilter = columnHandler.excludedInInsertStatement().negate().and(c -> includedFields.test(c.getId()));
  this.insertStatement = getInsertStatement(insertColumnFilter);
  this.updateColumnFilter = columnHandler.excludedInUpdateStatement().negate().and(c -> includedFields.test(c.getId()));
  this.updateStatement = getUpdateStatement(updateColumnFilter);
  deleteStatement = template.deleteStatement;
  generatedFieldSupports = template.generatedFieldSupports;
  generatedFields = template.generatedFields;
  columnsByFields = template.columnsByFields;
}
origin: speedment/speedment

.filter(t -> t.getId().equals(table.getId()))
.flatMap(Table::columns)
.filter(c -> c.getId().equals(column.getId()))
origin: speedment/speedment

+ "Fallback to JDBC-type %s",
table.getId(),
column.getId(),
md.getTypeName(),
md.getDataType(),
origin: speedment/speedment

ImmutableColumn(ImmutableTable parent, Map<String, Object> data) {
  super(parent, data);
  
  final Column prototype = new ColumnImpl(parent, data);
  
  this.enabled                = prototype.isEnabled();
  this.id                     = prototype.getId();
  this.name                   = prototype.getName();
  this.alias                  = prototype.getAlias();
  this.nullable               = prototype.isNullable();
  this.nullableImplementation = prototype.getNullableImplementation();
  this.autoincrement          = prototype.isAutoIncrement();
  this.typeMapper             = prototype.getTypeMapper();
  this.databaseType           = prototype.getDatabaseType();
  this.databaseTypeObject     = prototype.findDatabaseType();
  this.enumConstants          = prototype.getEnumConstants();
  this.decimalDigits          = prototype.getDecimalDigits();
  this.columnSize             = prototype.getColumnSize();
  this.ordinalPosition        = prototype.getOrdinalPosition();
}
origin: speedment/speedment

identifierEnum.add(EnumConstant.of(constant).add(Value.ofText(col.getId())));
origin: com.speedment.runtime/runtime-core

@Override
public Persister<ENTITY> persister(HasLabelSet<ENTITY> includedFields) {
  Predicate<Column> columns = insertColumnFilter.and(c -> includedFields.test(c.getId()));
  String statement = getInsertStatement(updateColumnFilter.and(c12 -> includedFields.test(c12.getId())));
  return entity -> persist(entity, f -> columns.test(columnsByFields.get(f)), statement);
}
origin: com.speedment.runtime/runtime-core

@Override
public Updater<ENTITY> updater(HasLabelSet<ENTITY> includedFields) {
  assertHasPrimaryKeyColumns();
  Predicate<Column> columns = updateColumnFilter.and(c -> includedFields.test(c.getId()));
  String statement = getUpdateStatement(updateColumnFilter.and(c12 -> includedFields.test(c12.getId())));
  return entity -> update(entity, f -> columns.test(columnsByFields.get(f)), statement);
}
origin: com.speedment.runtime/runtime-join

private static int findNullOffset(
  final Table table,
  final Stage<?> stage,
  final HasComparableOperators<?, ?> field
) {
  int result = -1;
  final String onColumnId = field
    .identifier()
    .getColumnId();
  final List<Column> columns = table.columns()
    .filter(Column::isEnabled)
    .collect(toList());
  for (int j = 0; j < columns.size(); j++) {
    final String columnId = columns.get(j).getId();
    if (columnId.equals(onColumnId)) {
      // Compose a null detecting entity mapper
      result = j;
      break;
    }
  }
  if (result == -1) {
    throw new IllegalStateException(
      "Unable to locate column " + onColumnId + " in table " + table.getId()
      + " for stage " + stage.toString()
      + " Columns: " + columns.stream().map(Column::getId).collect(joining(", "))
    );
  }
  return result;
}
origin: com.speedment.runtime/runtime-core

private SqlPersistenceImpl(SqlPersistenceImpl<ENTITY> template, HasLabelSet<ENTITY> includedFields) {
  primaryKeyFields = template.primaryKeyFields;
  fields = template.fields;
  dbms = template.dbms;
  table = template.table;
  dbmsType = template.dbmsType;
  sqlTableReference = template.sqlTableReference;
  hasPrimaryKeyColumns = template.hasPrimaryKeyColumns;
  naming = template.naming;
  operationHandler = template.operationHandler;
  columnHandler = template.columnHandler;
  entityClass = template.entityClass;
  this.insertColumnFilter = columnHandler.excludedInInsertStatement().negate().and(c -> includedFields.test(c.getId()));
  this.insertStatement = getInsertStatement(insertColumnFilter);
  this.updateColumnFilter = columnHandler.excludedInUpdateStatement().negate().and(c -> includedFields.test(c.getId()));
  this.updateStatement = getUpdateStatement(updateColumnFilter);
  deleteStatement = template.deleteStatement;
  generatedFieldSupports = template.generatedFieldSupports;
  generatedFields = template.generatedFields;
  columnsByFields = template.columnsByFields;
}
com.speedment.runtime.configColumngetId

Popular methods of Column

  • findDatabaseType
  • getDatabaseType
  • getName
  • getParentOrThrow
  • getTypeMapper
  • isNullable
  • mutator
  • getJavaName
  • getEnumConstants
  • getNullableImplementation
  • isAutoIncrement
  • isEnabled
  • isAutoIncrement,
  • isEnabled,
  • getAlias,
  • getAsBoolean,
  • getAsString,
  • getColumnSize,
  • getData,
  • getDecimalDigits,
  • getOrdinalPosition

Popular in Java

  • Reading from database using SQL prepared statement
  • getSharedPreferences (Context)
  • addToBackStack (FragmentTransaction)
  • setScale (BigDecimal)
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • Table (org.hibernate.mapping)
    A relational table
  • Option (scala)
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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