name
stringlengths
12
178
code_snippet
stringlengths
8
36.5k
score
float64
3.26
3.68
morf_MySqlDialect_makeStringLiteral_rdh
/** * Backslashes in MySQL denote escape sequences and have to themselves be escaped. * * @see <a href="http://dev.mysql.com/doc/refman/5.0/en/string-literals.html">String Literals</a> * @see org.alfasoftware.morf.jdbc.SqlDialect#makeStringLiteral(java.lang.String) */ @Override protected String makeStringLiteral(...
3.26
morf_MySqlDialect_m0_rdh
/** * CONSTRAINT TABLENAME_PK PRIMARY KEY (`X`, `Y`, `Z`) */ private String m0(String tableName, List<String> primaryKeyColumns) { return new StringBuilder().append("CONSTRAINT `").append(tableName).append("_PK` ").append("PRIMARY KEY (`").append(Joiner.on("`, `").join(primaryKeyColumns)).append("`)").toStrin...
3.26
morf_MySqlDialect_sqlForDefaultClauseLiteral_rdh
/** * For MySQL, we need to alter the way we render a date literal in a default clause: We need to suppress the "DATE" prefix. */ @Override protected String sqlForDefaultClauseLiteral(Column column) { if (column.getType() != DataType.DATE) { return super.sqlForDefaultClauseLiteral(column); } // ...
3.26
morf_MySqlDialect_fetchSizeForBulkSelects_rdh
/** * MySQL defaults to <a href="http://stackoverflow.com/questions/20496616/fetchsize-in-resultset-set-to-0-by-default">fetching * <em>all</em> records</a> into memory when a JDBC query is executed, which causes OOM * errors when used with large data sets (Cryo and ETLs being prime offenders). Ideally * we would u...
3.26
morf_MySqlDialect_dropPrimaryKey_rdh
/** * ALTER TABLE `XYZ` DROP PRIMARY KEY */ private String dropPrimaryKey(String tableName) { return ("ALTER TABLE `" + tableName) + "` DROP PRIMARY KEY"; }
3.26
morf_MySqlDialect_getDatabaseType_rdh
/** * * @see org.alfasoftware.morf.jdbc.SqlDialect#getDatabaseType() */ @Override public DatabaseType getDatabaseType() { return DatabaseType.Registry.findByIdentifier(MySql.IDENTIFIER); }
3.26
morf_MySqlDialect_indexDeploymentStatements_rdh
/** * * @see org.alfasoftware.morf.jdbc.SqlDialect#indexDeploymentStatements(org.alfasoftware.morf.metadata.Table, org.alfasoftware.morf.metadata.Index) */ @Override protected Collection<String> indexDeploymentStatements(Table table, Index index) { StringBuilder statement = new StringBuilder(); statement.ap...
3.26
morf_MySqlDialect_m1_rdh
/** * * @see org.alfasoftware.morf.jdbc.SqlDialect#dropStatements(org.alfasoftware.morf.metadata.Table) */ @Override public Collection<String> m1(Table table) { return Arrays.asList(("FLUSH TABLES `" + table.getName()) + "`", ("DROP TABLE `" + table.getName()) + "`"); }
3.26
morf_MySqlDialect_getSqlForAddMonths_rdh
/** * * @see org.alfasoftware.morf.jdbc.SqlDialect#getSqlForAddMonths(org.alfasoftware.morf.sql.element.Function) */ @Override protected String getSqlForAddMonths(Function function) { return String.format("DATE_ADD(%s, INTERVAL %s MONTH)", getSqlFrom(function.getArguments().get(0)), g...
3.26
morf_MySqlDialect_alterTableDropColumnStatements_rdh
/** * * @see org.alfasoftware.morf.jdbc.SqlDialect#alterTableDropColumnStatements(org.alfasoftware.morf.metadata.Table, org.alfasoftware.morf.metadata.Column) */ @Override public Collection<String> alterTableDropColumnStatements(Table table, Column column) { List<String> result = new ArrayList<>(); S...
3.26
morf_MySqlDialect_getSqlForDateToYyyymmddHHmmss_rdh
/** * * @see org.alfasoftware.morf.jdbc.SqlDialect#getSqlForDateToYyyymmddHHmmss(org.alfasoftware.morf.sql.element.Function) */ @Override protected String getSqlForDateToYyyymmddHHmmss(Function function) { return String.format("CAST(DATE_FORMAT(%s, '%%Y%%m%%d%%H%%i%%s') AS DECIMAL(14))", getSqlFrom(function.getA...
3.26
morf_MySqlDialect_getSqlForDaysBetween_rdh
/** * * @see org.alfasoftware.morf.jdbc.SqlDialect#getSqlForDaysBetween(org.alfasoftware.morf.sql.element.AliasedField, org.alfasoftware.morf.sql.element.AliasedField) */@Override protected String getSqlForDaysBetween(AliasedField toDate, AliasedField fromDate) { return ((("TO_DAYS(" + getSqlFrom(toDate)) + ...
3.26
morf_TableBean_m0_rdh
/** * * @see org.alfasoftware.morf.metadata.Table#getName() */ @Override public String m0() { return tableName; }
3.26
morf_TableBean_isTemporary_rdh
/** * {@inheritDoc } * * @see org.alfasoftware.morf.metadata.Table#isTemporary() */ @Override public boolean isTemporary() { return isTemporary; }
3.26
morf_TableBean_columns_rdh
/** * * @see org.alfasoftware.morf.metadata.Table#columns() */ @Override public List<Column> columns() { return columns; }
3.26
morf_TableBean_indexes_rdh
/** * * @see org.alfasoftware.morf.metadata.Table#indexes() */ @Override public List<Index> indexes() { return indexes; }
3.26
morf_CompositeSchema_isEmptyDatabase_rdh
/** * * @see org.alfasoftware.morf.metadata.Schema#isEmptyDatabase() */ @Override public boolean isEmptyDatabase() { for (Schema schema : delegates) if (!schema.isEmptyDatabase()) return false; return true; }
3.26
morf_CompositeSchema_tables_rdh
/** * * @see org.alfasoftware.morf.metadata.Schema#tables() */ @Override public Collection<Table> tables() { Set<Table> result = Sets.newHashSet(); Set<String> seenTables = Sets.newHashSet(); for (Schema schema : delegates) { for (Table table : schema.tables()) { ...
3.26
morf_CompositeSchema_viewExists_rdh
/** * * @see org.alfasoftware.morf.metadata.Schema#viewExists(java.lang.String) */ @Override public boolean viewExists(String name) { for (Schema schema : delegates) if (schema.viewExists(name)) return true; return false; }
3.26
morf_CompositeSchema_getTable_rdh
/** * * @see org.alfasoftware.morf.metadata.Schema#getTable(java.lang.String) */ @Override public Table getTable(String name) { for (Schema schema : delegates) if (schema.tableExists(name)) return schema.getTable(name); throw new IllegalArgumentException(("Unknown table [" + nam...
3.26
morf_CompositeSchema_views_rdh
/** * * @see org.alfasoftware.morf.metadata.Schema#views() */ @Override public Collection<View> views() { Set<View> result = Sets.newHashSet(); Set<String> seenViews = Sets.newHashSet(); for (Schema schema : delegates) { for (View view : schema.views()) { if (seenViews.add(view.getNa...
3.26
morf_CompositeSchema_viewNames_rdh
/** * * @see org.alfasoftware.morf.metadata.Schema#viewNames() */ @Override public Collection<String> viewNames() { Set<String> result = Sets.newHashSet(); Set<String> seenViews = Sets.newHashSet();for (Schema schema : delegates) {for (View v16 : schema.views()) { ...
3.26
morf_CompositeSchema_tableExists_rdh
/** * * @see org.alfasoftware.morf.metadata.Schema#tableExists(java.lang.String) */ @Override public boolean tableExists(String name) { for (Schema schema : delegates) if (schema.tableExists(name)) return true; return false; }
3.26
morf_CompositeSchema_tableNames_rdh
/** * * @see org.alfasoftware.morf.metadata.Schema#tableNames() */ @Override public Collection<String> tableNames() { Set<String> result = Sets.newHashSet(); Set<String> seenTables = Sets.newHashSet(); for (Schema schema : delegates) { for (Table ta...
3.26
morf_CompositeSchema_getView_rdh
/** * * @see org.alfasoftware.morf.metadata.Schema#getView(java.lang.String) */ @Override public View getView(String name) { for (Schema schema : delegates) if (schema.viewExists(name)) return schema.getView(name); throw new IllegalArgumentException(("Unknown table [" + name) + "]")...
3.26
morf_WhenCondition_drive_rdh
/** * * @see org.alfasoftware.morf.util.ObjectTreeTraverser.Driver#drive(ObjectTreeTraverser) */@Override public void drive(ObjectTreeTraverser traverser) { traverser.dispatch(getCriterion()).dispatch(getValue()); }
3.26
morf_WhenCondition_deepCopy_rdh
/** * * @see org.alfasoftware.morf.util.DeepCopyableWithTransformation#deepCopy(org.alfasoftware.morf.util.DeepCopyTransformation) */ @Override public Builder<WhenCondition> deepCopy(DeepCopyTransformation transformer) { return TempTransitionalBuilderWrapper.wrapper(new WhenCondition(this, transformer)); }
3.26
morf_WhenCondition_getValue_rdh
/** * * @return the value */ public AliasedField getValue() { return value; }
3.26
morf_WhenCondition_toString_rdh
/** * * @see java.lang.Object#toString() */ @Overridepublic String toString() { return ((("WHEN [" + criterion) + "] THEN [") + value) + "]"; }
3.26
morf_WhenCondition_getCriterion_rdh
/** * * @return the criterion */ public Criterion getCriterion() { return criterion; }
3.26
morf_JdbcUrlElements_forDatabaseType_rdh
/** * Builder pattern constructor. * * @param databaseType * The database type identifier (see {@link DatabaseType#identifier()}). * @return The builder. */ public static Builder forDatabaseType(String databaseType) { return new Builder(databaseType); }
3.26
morf_JdbcUrlElements_toString_rdh
/** * * @see java.lang.Object#toString() */ @Overridepublic String toString() { return ((((((((((("JdbcUrlElements [databaseTypeIdentifier=" + databaseType) + ", host=") + hostName) + ", port=") + port) + ", instanceName=") + instanceName) + ", databaseName=") + databaseName) + ", schemaName=") + schemaName...
3.26
morf_JdbcUrlElements_getInstanceName_rdh
/** * * @return the instance name. The meaning of this varies between database types. */ public String getInstanceName() { return instanceName; }
3.26
morf_JdbcUrlElements_withInstanceName_rdh
/** * Sets the instance name. Defaults to null (no instance specified). * * @param instanceName * The instance name. * @return this */ public Builder withInstanceName(String instanceName) { this.instanceName = instanceName; return this; }
3.26
morf_JdbcUrlElements_hashCode_rdh
/** * * @see java.lang.Object#hashCode() */ @Override public int hashCode() { final int prime = 31; int result = 1; result = (prime * result) + (databaseType == null ? 0 : databaseType.hashCode()); result = (prime * result) + (databaseName == null ? 0 : databaseName.hashCode()); result = ...
3.26
morf_JdbcUrlElements_getDatabaseName_rdh
/** * * @return the database name. The meaning of this varies between database types. */ public String getDatabaseName() { return databaseName; }
3.26
morf_JdbcUrlElements_getSchemaName_rdh
/** * * @return the schema name. The meaning of this varies between database types. */ public String getSchemaName() { return schemaName; }
3.26
morf_JdbcUrlElements_withDatabaseName_rdh
/** * Sets the database name. Defaults to null (no database specified). * * @param databaseName * The database name * @return this */ public Builder withDatabaseName(String databaseName) { this.databaseName = databaseName; return this; }
3.26
morf_JdbcUrlElements_equals_rdh
/** * * @see java.lang.Object#equals(java.lang.Object) */ @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; JdbcUrlElements other = ((JdbcUrlElements) (obj)); if ...
3.26
morf_JdbcUrlElements_withSchemaName_rdh
/** * Sets the schema name. Defaults to null (no schema specified). * * @param schemaName * The schema name * @return this */ public Builder withSchemaName(String schemaName) { this.schemaName = schemaName; return this; } /** * * @return The {@link JdbcUrlElements}
3.26
morf_JdbcUrlElements_getHostName_rdh
/** * * @return the server host name. */ public String getHostName() { return hostName; }
3.26
morf_JdbcUrlElements_getPort_rdh
/** * * @return the TCP/IP Port to connect to. */ public int getPort() { return port; }
3.26
morf_JdbcUrlElements_withHost_rdh
/** * Sets the host. Defaults to null (no host specified). * * @param host * The host name. * @return this */ public Builder withHost(String host) { this.host = host; return this; }
3.26
morf_JdbcUrlElements_withPort_rdh
/** * Sets the port. Defaults to 0 (no port specified). * * @param port * The port number. * @return this */ public Builder withPort(int port) { this.port = port; return this; }
3.26
morf_DataSetHomology_convertToUppercase_rdh
/** * Converts each string from the source collection to uppercase in a new collection. * * @param source * the source collection * @return a new collection containing only uppercase strings */ private Set<String> convertToUppercase(final Collection<String> source) { return source.stream().map(String::toUpperCa...
3.26
morf_DataSetHomology_getDifferences_rdh
/** * * @return The list of differences detected by the comparison. */ public List<String> getDifferences() { return differences;}
3.26
morf_DataSetHomology_subtractTable_rdh
/** * Subtract the common tables from the tables provided */ private Set<String> subtractTable(Set<String> tables, Set<String> commonTables) { return Sets.difference(tables, commonTables); }
3.26
morf_DataSetHomology_dataSetProducersMatch_rdh
/** * Compare that the data in the two produces matches. * * The individual differences can be accessed by the {@link #getDifferences()} method. * * @param producer1 * The first producer * @param producer2 * The second producer * @return Whether the data sets are identical */ public boolean dataSetProduce...
3.26
morf_UpgradePathFinder_isStepDuplicated_rdh
/** * Checks if a given CandidateStep is duplicated based on its name in the upgradeAudit map. * A CandidateStep is considered duplicated if it has the same name but a different UUID * compared to the entries in the upgradeAudit map. * * @param step * The CandidateStep to be checked for duplication. * @param u...
3.26
morf_UpgradePathFinder_createStep_rdh
/** * Uses reflection to instantiate an upgrade step. * * @return An upgrade step instance. */ public UpgradeStep createStep() { try {Constructor<? extends UpgradeStep> constructor = clazz.getDeclaredConstructor(); constructor.setAccessible(true);// Permit package-protected classes return con...
3.26
morf_UpgradePathFinder_isApplicable_rdh
/** * Decides whether this step is applicable based on list of already applied steps and other conditions. * * @param stepsAlreadyApplied * List of already applied steps. * @param candidateSteps * List of all potential candidates. * @return true...
3.26
morf_UpgradePathFinder_readOnlyWithUUID_rdh
/** * Reads the {@link OnlyWith} UUID from a class, doing some sanity checking. * * @param upgradeStepClass * The upgrade step class. * @return The UUID of the referenced class; null if no annotation is present on the given class. */ public static UUID readOnlyWithUUID(Class<? extends UpgradeStep> upgradeStepCl...
3.26
morf_UpgradePathFinder_hasStepsToApply_rdh
/** * * @return Whether this path finder has steps to apply, based on the available steps and those already applied. */ public boolean hasStepsToApply() { return !stepsToApply.isEmpty(); }
3.26
morf_UpgradePathFinder_getName_rdh
/** * Tells the name of the upgrade step, i.e. the class name of the upgrade step. */ public String getName() { return clazz.getName(); }
3.26
morf_UpgradePathFinder_getSchemaChangeSequence_rdh
/** * Returns a {@link SchemaChangeSequence} from all steps to apply. * * @return All the steps to apply */ public SchemaChangeSequence getSchemaChangeSequence() { List<UpgradeStep> upgradeSteps = Lists.newArrayList(); for (CandidateStep upgradeStepClass : stepsToApply) { upgradeSteps.add(upgradeSt...
3.26
morf_UpgradePathFinder_schemasNotMatch_rdh
/** * Wraps calls to the {@link SchemaHomology} to provide debug logging. * * @param targetSchema * First schema to compare. * @param trialSchema * Second schema to compare. * @param firstSchemaContext * Context of the target schema for logging. * @param secondScehmaContext * Context of the trial sche...
3.26
morf_UpgradePathFinder_upgradeStepsToApply_rdh
/** * Returns a list of upgrade steps to be applied. */ private List<CandidateStep> upgradeStepsToApply() { final Map<UUID, CandidateStep> candidateSteps = candidateStepsByUUID(); return candidateSteps.values().stream().filter(step -> step.isApplicable(stepsAlreadyApplied, candidateSteps)).collect(Collectors...
3.26
morf_UpgradePathFinder_findDiscrepancies_rdh
/** * Finds discrepancies between a provided upgrade audit map and the list of steps to apply. * This method compares the UUIDs associated with each upgrade step in the provided list with the corresponding UUIDs * in the upgrade audit map. If discrepancies are found, it logs an error message and throws an IllegalSta...
3.26
morf_UpgradePathFinder_m0_rdh
/** * Tells the UUID referenced by the candidate via the {@link OnlyWith}. */ public UUID m0() { return onlyWithUuid; }
3.26
morf_UpgradePathFinder_readUUID_rdh
/** * Read the UUID from a class, doing some sanity checking. * * @param upgradeStepClass * The upgrade step class. * @return The UUID of the class. */ public static UUID readUUID(Class<? extends UpgradeStep> upgradeStepClass) { UUID annotation = upgradeStepClass.getAnno...
3.26
morf_UpgradePathFinder_getUuid_rdh
/** * Tells the UUID of the candidate. */ public UUID getUuid() { return uuid; }
3.26
morf_UpgradePathFinder_candidateStepsByUUID_rdh
/** * Transforms a collection of upgrade step classes into a map of UUIDs and {@link CandidateStep} instances. * * @throws IllegalStateException * if any particular UUID appears on more than once upgrade step class. */ private Map<UUID, CandidateStep> candidateStepsByUUID() { // track which candidate step is...
3.26
morf_InsertStatementDefaulter_getColumnsWithValues_rdh
/** * Gets a set of columns for which values have been provided. * * @param statement * the statement to parse. * @return a set of columns for which values have been provided. */ private Set<String> getColumnsWithValues(InsertStatement statement) { Set<String> columnsWithValues = new HashSet<>(); addCol...
3.26
morf_InsertStatementDefaulter_addColumnDefaults_rdh
/** * Adds the column defaults for missing columns to the {@code statement}. * * @param statement * the statement to add to. * @param columnsWithValues * the columns for which we have values. */ private InsertStatement addColumnDefaults(InsertStatement statement, Set<String> columnsWithValues) { Table ta...
3.26
morf_InsertStatementDefaulter_isNullDefaultType_rdh
/** * Determines whether the column is a type that will always be defaulted to * 'null'. i.e. dates, BLOBs and CLOBs. * * @param column * the column to check for. * @return true if the column should default to null. */ private boolean isNullDefaultType(Column column) { return ((column.getType() == DataTyp...
3.26
morf_InsertStatementDefaulter_defaultMissingFields_rdh
/** * Inserts default values for missing fields into the insert statement. * * @param statement * the {@link InsertStatement} to add defaults for. * @return an insert statement with appropriate defaults added. */ public InsertStatement defaultMissingFields(InsertStatement statement) { // Don't fiddle with p...
3.26
morf_InsertStatementDefaulter_addColumnsFromSchema_rdh
/** * Adds table columns from the schema. * * @param tableReference * the table reference to add for. * @param columnsWithValues * the set to add to. */ private void addColumnsFromSchema(TableReference tableReference, Set<String> columnsWithValues) { Table table = metadata.getTable(tableReference.getName...
3.26
morf_InsertStatementDefaulter_addColumns_rdh
/** * Adds the list of {@code fields} to the {@code columnsWithValues}. * * @param fields * the fields to add. * @param columnsWithValues * the set to add to. */ private void addColumns(List<AliasedField> fields, Set<String> columnsWithValues) { for (AliasedField field : fields) { columnsWithValu...
3.26
morf_InsertStatementDefaulter_getFieldDefault_rdh
/** * Gets the default value for the {@code column}. If the column has a default * value associated with it, this is returned. Otherwise a standard default is * given. * * @param column * The column to get the default for. * @return the default value to use. */ private AliasedField getFieldDefault(Column colu...
3.26
morf_SpreadsheetDataSetProducer_parseWorkbook_rdh
/** * Parse the workbook from an {@link InputStream}. * * @param inputStream * InputStream from the spreadsheet */ private void parseWorkbook(final InputStream inputStream) { Workbook workbook = null; try { final WorkbookSettings settings = new WorkbookSettings(); settings.setEncoding("CP1252...
3.26
morf_SpreadsheetDataSetProducer_close_rdh
/** * {@inheritDoc } * * @see org.alfasoftware.morf.dataset.DataSetProducer#close() */ @Override public void close() {// Nothing to do }
3.26
morf_SpreadsheetDataSetProducer_createTranslationRecord_rdh
/** * Creates the collection of translation records from a given set of * translations. * * @param id * ID of the translation record * @param translation * Translation string to create * @return the record representing the translation */ private Record createTranslationRecord(final int id, final String tra...
3.26
morf_SpreadsheetDataSetProducer_getSchema_rdh
/** * {@inheritDoc } * * @see org.alfasoftware.morf.dataset.DataSetProducer#getSchema() */ @Override public Schema getSchema() { return new Schema() { @Override public Table getTable(String name) { throw new UnsupportedOperationException("Cannot get the metadata of a table for a spreadsheet"); } @Override public b...
3.26
morf_SpreadsheetDataSetProducer_getTranslationsColumnIndex_rdh
/** * Determines if a worksheet contains something that looks like translations. * This is done by looking for a gap in the column headings followed by an * actual heading, e.g. * * <pre> * Heading 1 | Heading 2 | | Translation * ------------------------------------------------- * Value 1 | Value 2 ...
3.26
morf_SpreadsheetDataSetProducer_columnName_rdh
/** * Converts the given long name in to a column name. This is the same as * removing all the spaces and making the first character lowercase. * * @param longName * the long name to convert * @return the name of the column */ private String columnName(final String longName) { final String noSpaces = longName...
3.26
morf_SpreadsheetDataSetProducer_getDestinationWorksheet_rdh
/** * Gets the name of the destination worksheet for the given hyperlink. * * @param hyperlink * Hyperlink to determine worksheet name for * @return the name of the worksheet that the hyperlink points to */ private String getDestinationWorksheet(HyperlinkRecord hyperlink) { /* Hyperlinks will be either to a...
3.26
morf_SpreadsheetDataSetProducer_findHeaderRow_rdh
/** * Finds the heading row in a given worksheet. * * <p>This works by assuming that the table data starts in the row * immediately following a row containing hyperlinks that is after * a row that starts with "Parameters to Set Up". E.g.</p> * * <pre> * Parameters to Setup | | * --------------...
3.26
morf_SpreadsheetDataSetProducer_open_rdh
/** * {@inheritDoc } * * @see org.alfasoftware.morf.dataset.DataSetProducer#open() */ @Override public void open() { // Nothing to do }
3.26
morf_SpreadsheetDataSetProducer_countHeadings_rdh
/** * Counts the number of headings in the given sheet. This excludes any * heading related to translations. * * @param sheet * Worksheet to count headings in * @param headingRowIndex * Index of the heading row * @return the number of headings */ private int countHeadings(final Sheet sheet, final int headi...
3.26
morf_SpreadsheetDataSetProducer_getRecords_rdh
/** * Get all the records from the given Excel sheet. * * @param sheet * worksheet to get records from * @return the extracted records */ private List<Record> getRecords(Sheet sheet) { try { long id = 1; int row = findHeaderRow(sheet); // Get the column headings final Map<String, Integer> v21...
3.26
morf_SpreadsheetDataSetProducer_isTableEmpty_rdh
/** * * @see org.alfasoftware.morf.dataset.DataSetProducer#isTableEmpty(java.lang.String) */ @Override public boolean isTableEmpty(String tableName) { return tables.get(tableName).isEmpty(); }
3.26
morf_SpreadsheetDataSetProducer_records_rdh
/** * {@inheritDoc } * * @see org.alfasoftware.morf.dataset.DataSetProducer#records(java.lang.String) */ @Override public Iterable<Record> records(String tableName) { return tables.get(tableName);}
3.26
morf_SpreadsheetDataSetProducer_createRecord_rdh
/** * Creates a record from a set of cells from a worksheet. * * @param id * ID of the row * @param columnHeadingsMap * Map of column headings to their index * @param translationColumn * Column containing translations * @param cells * The cells to process * @return the created record */ private Reco...
3.26
morf_DataMaskingXmlDataSetConsumer_getValue_rdh
/** * If the provided column should be masked then return null, otherwise return the value. */ @Override protected String getValue(Record record, Column column, String table) { if (tableColumnsToMask.containsKey(table) && tableColumnsToMask.get(table).contains(column.getName())) { return null; } ...
3.26
morf_Table_primaryKey_rdh
/** * * @return The column definitions of the columns in the primary key. */ public default List<Column> primaryKey() { return columns().stream().filter(Column::isPrimaryKey).collect(Collectors.toList()); }
3.26
morf_DeleteStatement_deepCopy_rdh
/** * * @see org.alfasoftware.morf.util.DeepCopyableWithTransformation#deepCopy(org.alfasoftware.morf.util.DeepCopyTransformation) */ @Override public DeleteStatementBuilder deepCopy(DeepCopyTransformation transformer) { return new DeleteStatementBuilder(this, transformer); }
3.26
morf_DeleteStatement_getWhereCriterion_rdh
/** * Gets the where criteria. * * @return the where criteria */ public Criterion getWhereCriterion() { return whereCriterion; }
3.26
morf_DeleteStatement_getTable_rdh
/** * Gets the table being deleted from. * * @return the table being inserted into */ public TableReference getTable() { return f0;}
3.26
morf_DeleteStatement_delete_rdh
/** * Constructs a Delete Statement. See class-level documentation for usage instructions. * * @param table * the database table to delete from. * @return A builder. */ public static DeleteStatementBuilder delete(TableReference table) { return new DeleteStatementBuilder(table); }
3.26
morf_DeleteStatement_drive_rdh
/** * * @see org.alfasoftware.morf.util.ObjectTreeTraverser.Driver#drive(ObjectTreeTraverser) */ @Override public void drive(ObjectTreeTraverser traverser) { traverser.dispatch(getTable()).dispatch(getWhereCriterion()).dispatch(getLimit()); }
3.26
morf_DeleteStatement_where_rdh
/** * Specifies the where criteria * * <blockquote><pre>delete([table]) * .where([criteria]);</pre></blockquote> * * @param criterion * the criteria to filter the results by * @return a statement with the change applied. */ public DeleteStatement where(Criterion criterion) { return copyOnWriteOrMutate...
3.26
morf_DeleteStatement_shallowCopy_rdh
/** * Performs a shallow copy to a builder, allowing a duplicate * to be created and modified. * * @return A builder, initialised as a duplicate of this statement. */ @Override public DeleteStatementBuilder shallowCopy() { return new DeleteStatementBuilder(this); }
3.26
morf_DeleteStatement_getLimit_rdh
/** * Gets the limit. * * @return the limit on the number of deleted records. */ public Optional<Integer> getLimit() { return limit; }
3.26
morf_DeleteStatement_copyOnWriteOrMutate_rdh
/** * Either shallow copies and mutates the result, returning it, * or mutates the statement directly, depending on * {@link AliasedField#immutableDslEnabled()}. * * TODO for removal along with mutable behaviour. * * @param transform * A transform which modifies the shallow copy builder. * @param mutator * ...
3.26
morf_DatabaseMetaDataProvider_loadTable_rdh
/** * Loads a table. * * @param tableName * Name of the table. * @return The table metadata. */ protected Table loadTable(AName tableName) { final RealName realTableName = tableNames.get().get(tableName); if (realTableName == null) { throw new IllegalArgumentException(("Table [" + tableName) + ...
3.26
morf_DatabaseMetaDataProvider_loadAllViewNames_rdh
/** * Creates a map of all view names, * indexed by their case-agnostic names. * * @return Map of real view names. */ protected Map<AName, RealName> loadAllViewNames() { final ImmutableMap.Builder<AName, RealName> viewNameMappings = ImmutableMap.builder(); try { final DatabaseMetaData databaseMe...
3.26
morf_DatabaseMetaDataProvider_named_rdh
/** * Creates {@link AName} for searching the maps within this metadata provider. * * <p> * Metadata providers need to use case insensitive keys for lookup maps, since * database object name are considered case insensitive. While the same could * be achieved by simply upper-casing all database object names, such ...
3.26
morf_DatabaseMetaDataProvider_loadTablePrimaryKey_rdh
/** * Loads the primary key column names for the given table name, * as a map of case-agnostic names and respective positions within the key. * * @param tableName * Name of the table. * @return Map of respective positions by col...
3.26
morf_DatabaseMetaDataProvider_loadView_rdh
/** * Loads a view. * * @param viewName * Name of the view. * @return The view metadata. */ protected View loadView(AName viewName) { final RealName realViewName = viewNames.get().get(viewName); if (realViewName == null) { throw new IllegalArgumentException(("View [" + viewName) + "] not found...
3.26
morf_DatabaseMetaDataProvider_tables_rdh
/** * * @see org.alfasoftware.morf.metadata.Schema#tables() */ @Override public Collection<Table> tables() { return tableNames.get().values().stream().map(RealName::getRealName).map(this::getTable).collect(Collectors.toList()); }
3.26