/** Shorthand for {@link getTable(String,String,String)} **/ public Table getTable(TableIdentifier ti) { return dbs.getTable(ti.getSchema(), ti.getCatalog(), ti.getName()); }
public List<Table> readDatabaseSchema(DatabaseCollector dbs, String catalog, String schema) { return readDatabaseSchema(dbs, catalog, schema, new NoopProgressListener()); }
public TableFilter() { setMatchCatalog(".*"); setMatchSchema(".*"); setMatchName(".*"); setExclude(null); }
public String tableToClassName(TableIdentifier tableIdentifier) { String pkgName = settings.getDefaultPackageName(); String className = toUpperCamelCase( tableIdentifier.getName() ); if(pkgName.length()>0) { return StringHelper.qualify(pkgName, className); } else { return className; } }
/** * Initialize the settings. * * If subclasses need to use the Settings then it should keep its own reference, but still remember to initialize the delegates settings by calling super.setSettings(settings). * * @see ReverseEngineeringStrategy.setSettings */ public void setSettings(ReverseEngineeringSettings settings) { if(delegate!=null) delegate.setSettings(settings); }
public static TableIdentifier createTableIdentifier( Table table, String defaultCatalog, String defaultSchema) { String tableName = table.getName(); String tableCatalog = getCatalogForModel(table.getCatalog(), defaultCatalog); String tableSchema = getSchemaForModel(table.getSchema(), defaultSchema); return new TableIdentifier(tableCatalog, tableSchema, tableName); }
/** * Method loadAndMergeMetaMap. * @param classElement * @param inheritedMeta * @return MultiMap */ public static MultiMap loadAndMergeMetaMap( Element classElement, MultiMap inheritedMeta) { return MetaAttributeBinder.mergeMetaMaps(loadMetaMap(classElement), inheritedMeta); }
TypeMappingKey(SQLTypeMapping mpa) { type = mpa.getJDBCType(); length = mpa.getLength(); }
public String columnToPropertyName(TableIdentifier table, String column) { String result = propertyNameForColumn.get(new TableColumnKey(table, column)); if(result==null) { return super.columnToPropertyName(table, column); } else { return result; } }
private String getPreferredHibernateType(int sqlType, int length, int precision, int scale, boolean nullable) { List<SQLTypeMapping> l = typeMappings.get(new TypeMappingKey(sqlType,length) ); if(l == null) { // if no precise length match found, then try to find matching unknown length matches l = typeMappings.get(new TypeMappingKey(sqlType,SQLTypeMapping.UNKNOWN_LENGTH) ); } return scanForMatch( sqlType, length, precision, scale, nullable, l ); }
public String keyWordCheck(String possibleKeyword) { if(ReverseEngineeringStrategyUtil.isReservedJavaKeyword(possibleKeyword)) { possibleKeyword = possibleKeyword + "_"; } return possibleKeyword; }
public boolean equals(TableIdentifier otherIdentifier) { if (otherIdentifier==null) return false; if (this==otherIdentifier) return true; if (equals(this.name, otherIdentifier.name) ) { if(equals(this.schema, otherIdentifier.schema) ) { return equals(this.catalog, otherIdentifier.catalog); } } return false; }
/** * Look up the table identified by the parameters in the currently found tables. * Warning: The table might not be fully initialized yet. * * @param catalog * @param schema * @param name * @return Table if found in processd tables, null if not */ public Table getTable(String catalog, String schema, String name) { return dbs.getTable(schema, catalog, name); }
/** * * @return null if filter does not affect this identifier, true/false if it does. */ public Boolean exclude(TableIdentifier identifier) { return isRelevantFor(identifier) ? exclude : null; }
public String foreignKeyToInverseEntityName(String keyname, TableIdentifier fromTable, List<?> fromColumnNames, TableIdentifier referencedTable, List<?> referencedColumnNames, boolean uniqueReference) { return delegate==null?null:delegate.foreignKeyToInverseEntityName(keyname, fromTable, fromColumnNames, referencedTable, referencedColumnNames, uniqueReference); }
public String foreignKeyToInverseEntityName(String keyname, TableIdentifier fromTable, List<?> fromColumnNames, TableIdentifier referencedTable, List<?> referencedColumnNames, boolean uniqueReference) { return foreignKeyToEntityName(keyname, fromTable, fromColumnNames, referencedTable, referencedColumnNames, uniqueReference); }
private static DefaulAssociationInfo ensureInit( DefaulAssociationInfo associationInfo) { return associationInfo==null?new DefaulAssociationInfo():associationInfo; }
private OverrideRepository add(Document doc) { OverrideBinder.bindRoot(this, doc); return this; }
private String keywordCheck(String possibleKeyword) { if(ReverseEngineeringStrategyUtil.isReservedJavaKeyword(possibleKeyword)) { possibleKeyword = possibleKeyword + "_"; } return possibleKeyword; }