name stringlengths 12 178 | code_snippet stringlengths 8 36.5k | score float64 3.26 3.68 |
|---|---|---|
morf_SqlScriptExecutor_processWith_rdh | /**
*
* @see org.alfasoftware.morf.jdbc.SqlScriptExecutor.QueryBuilder#processWith(org.alfasoftware.morf.jdbc.SqlScriptExecutor.ResultSetProcessor)
*/
@Override
public <T> T processWith(final ResultSetProcessor<T> resultSetProcessor) {
try {
final Holder<T> holder = new Holder<>();
Work work = ne... | 3.26 |
morf_SqlScriptExecutor_m0_rdh | /**
* Runs a select statement, with optional parameters, allowing its
* {@link ResultSet} to be processed by the supplied implementation of
* {@link ResultSetProcessor}. {@link ResultSetProcessor#process(ResultSet)}
* can return a value of any type, which will form the return value of this
* method.
*
* @param q... | 3.26 |
morf_SqlScriptExecutor_set_rdh | /**
*
* @param value
* the value to set
*/
void set(T value) {
this.value = value;} | 3.26 |
morf_SqlScriptExecutor_reclassifiedRuntimeException_rdh | /**
* Reclassify an exception if it is dialect specific and wrap in a runtime exception.
*/
private RuntimeException reclassifiedRuntimeException(Exception e, String message) {
Exception reclassifiedException = sqlDialect.getDatabaseType().reclassifyException(e);
return reclassifiedException instanceof SQLExc... | 3.26 |
morf_SqlScriptExecutor_executeAndCommit_rdh | /**
* Runs a batch of SQL statements.
*
* @param sqlScript
* SQL statements to run.
* @param connection
* Database against which to run SQL statements.
* @return The number of rows updated/affected by the statements in total.
*/
public int executeAndCommit(Iterable<St... | 3.26 |
morf_SqlScriptExecutor_executionStart_rdh | /**
*
* @see org.alfasoftware.morf.jdbc.SqlScriptExecutor.SqlScriptVisitor#executionStart()
*/
@Override
public void executionStart() {// Defaults to no-op
} | 3.26 |
morf_SqlScriptExecutor_withQueryTimeout_rdh | /**
*
* @see org.alfasoftware.morf.jdbc.SqlScriptExecutor.QueryBuilder#withQueryTimeout(int)
*/
@Override
public QueryBuilder withQueryTimeout(int queryTimeout) {
this.queryTimeout = Optional.of(queryTimeout);
return this;
} | 3.26 |
morf_SqlScriptExecutor_executionEnd_rdh | /**
*
* @see org.alfasoftware.morf.jdbc.SqlScriptExecutor.SqlScriptVisitor#executionEnd()
*/
@Override
public void executionEnd() {
// Defaults to no-op
} | 3.26 |
morf_SqlScriptExecutor_withParameterData_rdh | /**
*
* @see org.alfasoftware.morf.jdbc.SqlScriptExecutor.QueryBuilder#withParameterData(org.alfasoftware.morf.metadata.DataValueLookup)
*/
@Override
public QueryBuilder withParameterData(DataValueLookup parameterData) {
this.parameterData = parameterData;
return this;
} | 3.26 |
morf_SqlScriptExecutor_withMaxRows_rdh | /**
*
* @see org.alfasoftware.morf.jdbc.SqlScriptExecutor.QueryBuilder#withMaxRows(java.util.Optional)
*/
@Override
public QueryBuilder withMaxRows(Optional<Integer> maxRows) {
this.maxRows = maxRows;
return this;
} | 3.26 |
morf_SqlScriptExecutor_executeInternal_rdh | /**
*
* @param sql
* the sql statement to run.
* @param connection
* Database against which to run SQL statements.
* @return The number of rows updated/affected by this statement
* @throws SQLException
* throws an exception for statement errors.
*/
private int executeInternal(String sql, Connection conne... | 3.26 |
morf_SqlScriptExecutor_executeQuery_rdh | /**
* Runs a {@link NamedParameterPreparedStatement} (with parameters), allowing
* its {@link ResultSet} to be processed by the supplied implementation of
* {@link ResultSetProcessor}. {@link ResultSetProcessor#process(ResultSet)}
* can return a value of any type, which will form the return value of this
* method.... | 3.26 |
morf_SqlScriptExecutor_get_rdh | /**
*
* @return the value
*/
T get() {
return value;
} | 3.26 |
morf_SqlScriptExecutor_executeStatementBatch_rdh | /**
* Runs the specified SQL statement (which should contain parameters), repeatedly for
* each record, mapping the contents of the records into the statement parameters in
* their defined order. Use to insert, merge or update a large batch of records
* efficiently.
*
* @param sqlStatement
* the SQL statement... | 3.26 |
morf_SqlScriptExecutor_beforeExecute_rdh | /**
*
* @see org.alfasoftware.morf.jdbc.SqlScriptExecutor.SqlScriptVisitor#beforeExecute(java.lang.String)
*/
@Override
public void beforeExecute(String sql) {
// Defaults to no-op
} | 3.26 |
morf_DataType_hasScale_rdh | /**
*
* @return Whether this DataType has a variable width
*/
public boolean hasScale() {
return hasScale;
} | 3.26 |
morf_DataType_hasWidth_rdh | /**
*
* @return Whether this DataType has a variable width
*/
public boolean hasWidth() {
return hasWidth;
} | 3.26 |
morf_SelectFirstStatement_deepCopy_rdh | /**
*
* @see org.alfasoftware.morf.util.DeepCopyableWithTransformation#deepCopy(org.alfasoftware.morf.util.DeepCopyTransformation)
*/
@Override
public SelectFirstStatementBuilder deepCopy(DeepCopyTransformation transformer) {
return new SelectFirstStatementBuilder(this, transformer);
} | 3.26 |
morf_SelectFirstStatement_asField_rdh | /**
*
* @see org.alfasoftware.morf.sql.AbstractSelectStatement#asField()
*/
@Override
public AliasedField asField() {
return new FieldFromSelectFirst(this);
} | 3.26 |
morf_SelectFirstStatement_toString_rdh | /**
*
* @see org.alfasoftware.morf.sql.AbstractSelectStatement#toString()
*/
@Override
public String toString() {
StringBuilder result = new StringBuilder("SQL SELECT FIRST ");
result.append(super.toString());
return result.toString();
} | 3.26 |
morf_RemoveTable_reverse_rdh | /**
* {@inheritDoc }
*
* @see org.alfasoftware.morf.upgrade.SchemaChange#reverse(org.alfasoftware.morf.metadata.Schema)
*/
@Override
public Schema reverse(Schema schema) {
if (schema.tableExists(tableToBeRemoved.getName().toUpperCase())) {
throw new IllegalArgumentException(("Cannot perform reversal for [" + ta... | 3.26 |
morf_RemoveTable_accept_rdh | /**
* {@inheritDoc }
*
* @see org.alfasoftware.morf.upgrade.SchemaChange#accept(org.alfasoftware.morf.upgrade.SchemaChangeVisitor)
*/
@Overridepublic void accept(SchemaChangeVisitor visitor) {
visitor.visit(this);
} | 3.26 |
morf_RemoveTable_apply_rdh | /**
* {@inheritDoc }
*
* @see org.alfasoftware.morf.upgrade.SchemaChange#apply(org.alfasoftware.morf.metadata.Schema)
*/
@Override
public Schema apply(Schema schema) {
if (!schema.tableExists(tableToBeRemoved.getName().toUpperCase())) {
throw new IllegalArgumentException(("Cannot remove table [" + ta... | 3.26 |
morf_RemoveTable_isApplied_rdh | /**
* {@inheritDoc }
*
* @see org.alfasoftware.morf.upgrade.SchemaChange#isApplied(Schema, ConnectionResources)
*/
@Override
public boolean isApplied(Schema schema, ConnectionResources database) {
for (String tableName : schema.tableNames()) {
if (tableName.equalsIgn... | 3.26 |
morf_RemoveTable_getTable_rdh | /**
*
* @return the {@link Table} to be removed.
*/
public Table getTable() {
return
tableToBeRemoved;
} | 3.26 |
morf_InsertStatementBuilder_into_rdh | /**
* Inserts into a specific table.
*
* <blockquote><pre>
* new InsertStatement().into(new TableReference("agreement"));</pre></blockquote>
*
* @param intoTable
* the table to insert into.
* @return this, for method chaining.
*/
public InsertStatementBuilder into(TableReference intoTable) {
this.tabl... | 3.26 |
morf_InsertStatementBuilder_getTable_rdh | /**
* Gets the table being inserted into
*
* @return the table being inserted into
*/
TableReference getTable() {
return table;
} | 3.26 |
morf_InsertStatementBuilder_getSelectStatement_rdh | /**
* Gets the select statement which will generate the data for the insert.
*
* @return the select statement to use, or null if none is specified.
*/
SelectStatement getSelectStatement() {
return selectStatement;
} | 3.26 |
morf_InsertStatementBuilder_useDirectPath_rdh | /**
* If supported by the dialect, hints to the database that an {@code APPEND} query hint should be used in the insert statement.
*
* <p>In general, as with all query plan modification, <strong>do not use this unless you know
* exactly what you are doing</strong>.</p>
*
* <p>These directives are applied in the S... | 3.26 |
morf_InsertStatementBuilder_useParallelDml_rdh | /**
* Request that this statement is executed with a parallel execution plan for data manipulation language (DML). This request will have no effect unless the database implementation supports it and the feature is enabled.
*
* <p>For statement that will affect a high percentage or rows in the table, a parallel execu... | 3.26 |
morf_InsertStatementBuilder_getValues_rdh | /**
*
* @return List of literal field values to insert to when not selecting data from another table.
*/
List<AliasedField> getValues() {
return values;
} | 3.26 |
morf_InsertStatementBuilder_getFields_rdh | /**
* Gets the list of fields to insert
*
* @return the fields being inserted into
*/
List<AliasedField> getFields() {
return fields;
} | 3.26 |
morf_InsertStatementBuilder_from_rdh | /**
* Specifies the table to source the data from
*
* @param sourceTable
* the table to source the data from
* @return this, for method chaining.
*/
public InsertStatementBuilder from(TableReference sourceTable) {
if (selectStatement != null) {
throw new UnsupportedOperationException("Cannot specif... | 3.26 |
morf_InsertStatementBuilder_getFromTable_rdh | /**
* Gets the table to select from. This is a short-hand for "SELECT * FROM [Table]".
*
* @return the table to select from.
*/
TableReference getFromTable() {
return fromTable;
} | 3.26 |
morf_InsertStatementBuilder_values_rdh | /**
* Specifies the literal field values to insert.
*
* <p>
* Each field must have an alias which specifies the column to insert into.
* </p>
*
* @see AliasedField#as(String)
* @param fieldValues
* Literal field values to insert.
* @return this, for method chaining.
*/
public InsertStatementBuilder
values(... | 3.26 |
morf_InsertStatementBuilder_fields_rdh | /**
* Specifies the fields to insert into the table.
*
* <p>
* NOTE: This method should not be used in conjunction with {@link #values}.
* </p>
*
* @param destinationFields
* the fields to insert into the database table
* @return this, for method chaining.
*/
public InsertStatementBuilder fields(Iterable<? ... | 3.26 |
morf_InsertStatementBuilder_getFieldDefaults_rdh | /**
* Gets the field defaults that should be used when inserting new fields.
*
* @return a map of field names to field default values to use during this insert.
*/
Map<String, AliasedField> getFieldDefaults() {
return fieldDefaults;
} | 3.26 |
morf_InsertStatementBuilder_avoidDirectPath_rdh | /**
* If supported by the dialect, hints to the database that an {@code APPEND} query hint should be used in the insert statement.
*
* <p>In general, as with all query plan modification, <strong>do not use this unless you know
* exactly what you are doing</strong>.</p>
*
* <p>These directives are applied in the S... | 3.26 |
morf_InsertStatementBuilder_withDefaults_rdh | /**
* Specifies the defaults to use when inserting new fields.
*
* @param defaultValues
* the list of values to use as defaults
* @return this, for method chaining.
*/
public InsertStatementBuilder withDefaults(List<AliasedFieldBuilder> defaultValues) {
for (AliasedField currentValue : Builder.Helper.buildA... | 3.26 |
morf_InsertStatementBuilder_getHints_rdh | /**
*
* @return all hints in the order they were declared.
*/
List<Hint> getHints() {
return hints;
} | 3.26 |
morf_UpgradeTableResolution_addDiscoveredTables_rdh | /**
* Adds information about read/modified tables by given upgrade step
*
* @param upgradeStepName
* name of the class of the upgrade step to be registered
* @param resolvedTables
* registry of read/modified tables
*/
public void addDiscoveredTables(String upgradeStepName, ResolvedTables resolvedTables) {
... | 3.26 |
morf_UpgradeTableResolution_getReadTables_rdh | /**
*
* @param upgradeStepName
* name of the class of the upgrade step to be checked
* @return all tables read by given upgrade step
*/
public Set<String> getReadTables(String upgradeStepName) {
return resolvedTablesMap.get(upgradeStepName) == null ? null : resolvedTablesMap.... | 3.26 |
morf_IdTableTracker_activeNameFor_rdh | /**
*
* @see org.alfasoftware.morf.upgrade.TableNameResolver#activeNameFor(java.lang.String)
*/
@Override
public String activeNameFor(String tableName) {
if ("IDTABLE".equals(tableName))
return idTableName;
return tableName;
} | 3.26 |
morf_SqlQueryDataSetProducer_records_rdh | /**
* Returns an iterable of records contained in the {@link ResultSet}.
*/
@Override
public Iterable<Record> records(String tableName) {
Table table = getSchema().getTable(tableName);
return new Iterable<Record>() {
@Override
public Iterator<Record> iterator() {
ResultSetItera... | 3.26 |
morf_SqlQueryDataSetProducer_isTableEmpty_rdh | /**
*
* @see org.alfasoftware.morf.dataset.DataSetProducer#isTableEmpty(java.lang.String)
*/@Override
public boolean isTableEmpty(String tableName) {
return records(tableName).iterator().hasNext();
} | 3.26 |
morf_SqlQueryDataSetProducer_close_rdh | /**
* Closes the connection and any active result sets.
*/
@Override
public void close() {
if (f0 == null) {
return;
}
try
{
for (ResultSetIterator resultSetIterator : openResultSets) {
resultSetIterator.close();
... | 3.26 |
morf_SqlQueryDataSetProducer_open_rdh | /**
* Opens a connection and prepares it.
*/
@Override
public void open() {
try {
this.f0 = dataSource.getConnection();
this.wasAutoCommit = f0.getAutoCommit();
// disable auto-commit on this connection for HSQLDB performance
wasAutoCommit = f0.getAutoCommit();
f0.setAuto... | 3.26 |
morf_SqlQueryDataSetProducer_getSchema_rdh | /**
* Returns a {@link Schema} containing information about the {@link Table}
* associated with this {@link ResultSet}.
*/
@Override
public Schema getSchema() {
return schema;
} | 3.26 |
morf_SchemaHomology_checkIndex_rdh | /**
* Check two indexes match.
*
* @param index1
* index to compare
* @param index2
* index to compare
*/
private void checkIndex(String tableName, Index index1, Index index2) {
matches(("Index name on table [" + tableName) + "]", index1.getName().toUpperCase(), index2.getName().toUpperCase());
matches((((... | 3.26 |
morf_SchemaHomology_differences_rdh | /**
*
* @return the differences
*/
public List<String> differences() {
return differences;
} | 3.26 |
morf_SchemaHomology_difference_rdh | /**
*
* @see org.alfasoftware.morf.metadata.SchemaHomology.DifferenceWriter#difference(java.lang.String)
*/
@Override
public void difference(String message) {
differences.add(message);
} | 3.26 |
morf_SchemaHomology_columnsMatch_rdh | /**
* Compare two columns.
*
* @param column1
* Column 1
* @param column2
* Column 2
* @return Whether they match.
*/
public boolean columnsMatch(Column column1, Column column2) {
noDifferences = true;
checkColumn(null, column1, column2);
return noDifferences;
} | 3.26 |
morf_SchemaHomology_checkColumn_rdh | /**
*
* @param tableName
* The table which contains the columns. Can be null, in which case the errors don't contain the table name.
* @param column1
* First column to compare.
* @param column2
* Second column to compare.
*/
private void checkColumn(String
tableName, Column column1, Column column2) {
ma... | 3.26 |
morf_SchemaHomology_matches_rdh | /**
* Check two objects match, writing a difference if they don't.
*
* @param description
* The description to log when the match fails
* @param value1
* The first value
* @param value2
* The second value
*/
private void matches(String description, Object value1, Object value2) {
if (ObjectUtils.notEqua... | 3.26 |
morf_SchemaHomology_checkTable_rdh | /**
*
* @param table1
* First table to compare.
* @param table2
* Second table to compare.
*/
private void checkTable(Table table1, Table table2) {
matches("Table name", table1.getName().toUpperCase(), table2.getName().toUpperCase());
checkColumns(table1.getName(), table1.columns(), table2.columns());
checkIn... | 3.26 |
morf_SchemaHomology_checkColumns_rdh | /**
* Compare the columns of two tables.
*
* @param tableName
* The table from which the columns came
* @param columns1
* The first set of columns
* @param columns2
* The second set of columns
*/ private void checkColumns(String tableName, List<Column> columns1, List<Column> columns2) {
// Note that we c... | 3.26 |
morf_SchemaHomology_checkIndexes_rdh | /**
* Compare the indexes of two tables.
*
* @param tableName
* Name of the table on which we are comparing indexes.
* @param indexes1
* The first set of indexes
* @param indexes2
* The second set of indexes
*/
private void checkIndexes(String tableName, List<Index> indexes1, List<Index> indexes2) {
Map<... | 3.26 |
morf_SchemaHomology_schemasMatch_rdh | /**
*
* @param schema1
* First schema to compare.
* @param schema2
* Second schema to compare.
* @param exclusionRegex
* A {@link Collection} of regular expressions that corresponds to tables that will be ignored if only found in one schema.
* @return True if each of th... | 3.26 |
morf_SchemaHomology_checkPrimaryKeys_rdh | /**
* Checks the ordering of the primary keys.
*/
private void checkPrimaryKeys(String tableName, List<String> table1UpperCaseKeys, List<String> table2UpperCaseKeys) {
if (table1UpperCaseKeys.size() != table2UpperCaseKeys.size()) {difference(String.format("Primary key column count on table [%s] does not match. Colum... | 3.26 |
morf_SchemaHomology_indexesMatch_rdh | /**
* Compare two indexes.
*
* @param index1
* Index 1
* @param index2
* Index 2
* @return Whether they match.
*/
public boolean indexesMatch(Index index1, Index index2) {
noDifferences = true; checkIndex("unspecified", index1, index2);
return noDifferences;
} | 3.26 |
morf_AddTableFrom_getSelectStatement_rdh | /**
*
* @return the {@link SelectStatement} to be used.
*/
public SelectStatement getSelectStatement() {
return selectStatement;
} | 3.26 |
morf_AddTableFrom_accept_rdh | /**
*
* @see org.alfasoftware.morf.upgrade.SchemaChange#accept(org.alfasoftware.morf.upgrade.SchemaChangeVisitor)
*/
@Override
public void accept(SchemaChangeVisitor visitor) {
visitor.visit(this);
} | 3.26 |
morf_AliasedField_getAlias_rdh | /**
* Gets the alias of the field.
*
* @return the alias
*/public String getAlias() {
return alias;
} | 3.26 |
morf_AliasedField_asDate_rdh | /**
*
* @return this field cast from a YYYYMMDD string to a SQL date.
*/
public AliasedField asDate() {
return Function.yyyymmddToDate(this);
} | 3.26 |
morf_AliasedField_multiplyBy_rdh | /**
*
* @param expression
* value to multiply this field by.
* @return A new expression using {@link MathsField} and {@link MathsOperator#MULTIPLY}.
*/
public final MathsField multiplyBy(AliasedField expression) {
return new MathsField(this, MathsOperator.MULTIPLY, potentiallyBracketExpression(expression));
... | 3.26 |
morf_AliasedField_isNull_rdh | /**
*
* @return criteria for this field being null
*/
public Criterion isNull() {
return Criterion.isNull(this);} | 3.26 |
morf_AliasedField_deepCopy_rdh | /**
*
* @see org.alfasoftware.morf.util.DeepCopyableWithTransformation#deepCopy(org.alfasoftware.morf.util.DeepCopyTransformation)
*/@Override
public AliasedFieldBuilder deepCopy(DeepCopyTransformation transformer) {
return deepCopyInternal(transformer);
} | 3.26 |
morf_AliasedField_neq_rdh | /**
*
* @param value
* value to compare to
* @return criteria for non-equality of this field to value.
*/
public Criterion neq(Object value) {
return Criterion.neq(this, value);
} | 3.26 |
morf_AliasedField_greaterThan_rdh | /**
*
* @param value
* object to compare to (right hand side)
* @return a {@link Criterion} for a greater than expression of this field.
*/
public Criterion greaterThan(Object value) {
return Criterion.greaterThan(this, value);
} | 3.26 |
morf_AliasedField_in_rdh | /**
*
* @param values
* values for comparison
* @return A {@link Criterion#in(AliasedField, Object...)}.
*/
public Criterion in(Object... values) {
return Criterion.in(this, values);}
/**
*
* @param values
* The values for comparison
* @return The resulting {@link Criterion} | 3.26 |
morf_AliasedField_plus_rdh | /**
*
* @param expression
* value to add to this field.
* @return A new expression using {@link MathsField} and {@link MathsOperator#PLUS}.
*/
public final MathsField plus(AliasedField expression) {
return new MathsField(this, MathsOperator.PLUS, potentiallyBracketExpression(expression));
} | 3.26 |
morf_AliasedField_minus_rdh | /**
*
* @param expression
* value to subtract from this field.
* @return A new expression using {@link MathsField} and {@link MathsOperator#MINUS}.
*/
public final MathsField minus(AliasedField expression) {
return new MathsField(this, MathsOperator.MINUS, potentiallyBracketExpression(expression));
} | 3.26 |
morf_AliasedField_getImpliedName_rdh | /**
* Returns the name of the field either implied by its source or by its alias.
*
* @return The implied name of the field
*/
public String getImpliedName() {
return getAlias();
} | 3.26 |
morf_AliasedField_isNotNull_rdh | /**
*
* @return criteria for this field being not null
*/
public Criterion isNotNull() {
return Criterion.isNotNull(this);
} | 3.26 |
morf_AliasedField_negated_rdh | /**
*
* @return The value, negated, with the original implied name.
*/
public AliasedField negated() {
return SqlUtils.literal(0).minus(this).as(getImpliedName());
} | 3.26 |
morf_AliasedField_withImmutableBuildersEnabled_rdh | /**
* Allows tests to run with immutable building behaviour turned on.
*
* TODO remove when we remove the old mutable behaviour
*
* @param runnable
* The code to run.
*/
public static void withImmutableBuildersEnabled(Runnable runnable)
{
withImmutableBuilders(runnable, true);
} | 3.26 |
morf_AliasedField_m0_rdh | /**
* <p>We are transitioning from a model where {@link AliasedField} and its descendants
* are mutable - effectively combinations of the end object and its builder. Some
* {@link AliasedField} descendants have been converted to builders and immutable
* instances, and some not. In order for these to be used inter... | 3.26 |
morf_AliasedField_withImmutableBuildersDisabled_rdh | /**
* Allows tests to run with immutable building behaviour turned off.
*
* TODO remove when we remove the old mutable behaviour
*
* @param runnable
* The code to run.
*/
public static void withImmutableBuildersDisabled(Runnable runnable) {
withImmutableBuilders(runnable, false);
} | 3.26 |
morf_AliasedField_shallowCopy_rdh | /**
* Creates a shallow copy of the element, applying the alias.
*
* @param aliasName
* New alias.
* @return The shallow copy.
*/
protected AliasedField shallowCopy(String aliasName) {
throw new UnsupportedOperationException("Not refactored");
} | 3.26 |
morf_AliasedField_assetImmutableDslDisabled_rdh | /**
* TODO remove when we remove the old mutable behaviour.
*/
public static void assetImmutableDslDisabled() {
if (immutableDslEnabled()) {
throw new UnsupportedOperationException("Cannot modify a statement when immutability is configured.");
}
} | 3.26 |
morf_AliasedField_cast_rdh | /**
*
* @return Cast builder over this field.
*/
public CastBuilder cast() {
return SqlUtils.cast(this); } | 3.26 |
morf_AliasedField_eq_rdh | /**
*
* @param value
* value to compare to
* @return criteria for equality of this field to value.
*/
public Criterion eq(Object value) {
return Criterion.eq(this, value);
} | 3.26 |
morf_AliasedField_divideBy_rdh | /**
*
* @param expression
* value to use as the denominator.
* @return A new expression using {@link MathsField} and {@link MathsOperator#DIVIDE}.
*/
public final MathsField divideBy(AliasedField expression) {
return new MathsField(this, MathsOperator.DIVIDE, potentiallyBracketExpression(expression));
} | 3.26 |
morf_AliasedField_lessThanOrEqualTo_rdh | /**
*
* @param value
* object to compare to (right hand side)
* @return a {@link Criterion} for a less than or equal to expression of this field.
*/
public Criterion lessThanOrEqualTo(Object value) {
return Criterion.lessThanOrEqualTo(this,
value);} | 3.26 |
morf_AliasedField_immutableDslEnabled_rdh | /**
* TODO remove when we remove the old mutable behaviour
*
* @return true if immutable builder behaviour is enabled.
*/
public static boolean immutableDslEnabled() {
if (isImmutableBuilderEnabledThreadLocalOverride.get() != null) {
return isImmutableBuilderEnabledThreadLocalOverride.get();
}
return
Boolean.T... | 3.26 |
morf_AliasedField_greaterThanOrEqualTo_rdh | /**
*
* @param value
* object to compare to (right hand side)
* @return a {@link Criterion} for a greater than or equal to expression of this field.
*/
public Criterion greaterThanOrEqualTo(Object value) {
return Criterion.greaterThanOrEqualTo(this, value);
} | 3.26 |
morf_AliasedField_potentiallyBracketExpression_rdh | /**
* Brackets the expression if the expression is a Math field. Only the nested
* Math expressions should be put into the bracket during the expression
* serialisation.
* <p>
* Expressions are represented by a binary-tree structure. This structure
* holds information about all expression's operands. Each node is... | 3.26 |
morf_AliasedField_toString_rdh | /**
*
* @see java.lang.Object#toString()
*/@Override
public String toString() {
return StringUtils.isEmpty(alias) ? "" : " AS " + alias;
} | 3.26 |
morf_AliasedField_as_rdh | /**
* Specifies the alias to use for the field.
*
* <p>TODO uses transitional immutable logic. When this can be removed,
* we can make {@code alias final}.</p>
*
* @param aliasName
* the name of the alias
* @return an updated {@link AliasedField} (this will not be a new object)
*/
@Override
public AliasedFi... | 3.26 |
morf_AliasedField_lessThan_rdh | /**
*
* @param value
* object to compare to (right hand side)
* @return a {@link Criterion} for a less than expression of this field.
*/
public Criterion lessThan(Object value) {
return Criterion.lessThan(this, value);
} | 3.26 |
morf_SQLEntityNameValidationService_isReservedWord_rdh | /**
* Method to establish if a given string is an SQL Reserved Word
*
* @param word
* the string to establish if its a SQL Reserved Word
* @return true if its a SQL Reserved Word otherwise false.
*/
public boolean isReservedWord(String word) {
return schemaValidator.isSQLReservedWord(word);
} | 3.26 |
morf_SQLEntityNameValidationService_isNameConventional_rdh | /**
* <p>
* Method to establish if a name matches an allowed pattern of characters to
* follow the correct naming convention.
* </p>
* <p>
* The name must:
* </p>
* <ul>
* <li>begin with an alphabetic character [a-zA-Z]</li>
* <li>only contain alphanumeric characters or underscore [a-zA-Z0-9_]</li>
* </ul>
... | 3.26 |
morf_SQLEntityNameValidationService_isEntityNameLengthValid_rdh | /**
* Method to establish if a given string representing an Entity name is within
* the allowed length of charchaters.
*
* @see SchemaValidator#MAX_LENGTH
* @param name
* the string to establish if its within the allowed length
* @return true if its within the allowed length otherwise false.
*/
public boolean... | 3.26 |
morf_ResultSetIterator_advanceResultSet_rdh | /**
* Advances the underlying result set.
*/
private void advanceResultSet() {
try {
hasNext = this.resultSet.next();
if (hasNext) {
nextRecord = sqlDialect.resultSetToRecord(resultSet, f0);
} else {
close();
}
} catch (S... | 3.26 |
morf_ResultSetIterator_hasNext_rdh | /**
*
* @see java.util.Iterator#hasNext()
*/
@Override
public boolean hasNext() {
return hasNext;
} | 3.26 |
morf_ResultSetIterator_close_rdh | /**
*
* @see java.lang.AutoCloseable#close()
*/
@Overridepublic final void close() throws SQLException {
this.resultSet.close();
this.statement.close();
} | 3.26 |
morf_ResultSetIterator_getTable_rdh | /**
*
* @return the table
*/
public Table getTable() {
return table;
} | 3.26 |
morf_ResultSetIterator_remove_rdh | /**
*
* @see java.util.Iterator#remove()
*/@Override
public void remove() {
throw new UnsupportedOperationException("Cannot remove items from a result set iterator");
} | 3.26 |
morf_TableLoader_truncate_rdh | /**
* Empties the specified table.
*
* @param table
*/
private void truncate(Table table) {
// Get our own table definition based on the name to avoid case sensitivity bugs on some database vendors
log.debug(("Clearing table [" + table.getName()) + "]");
// Try to use a truncate
try {
runRec... | 3.26 |
morf_TableLoader_sqlInsertOrMergeLoad_rdh | /**
* Insert the data using an SQL insert.
*
* @param table
* The table we are inserting into.
* @param records
* The data to insert.
* @param connection
* The connection.
*/
private void sqlInsertOrMergeLoad(Table table, Iterable<Record> records, Connection co... | 3.26 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.