public String toString() { StringBuffer buf = new StringBuffer() .append( "TableIdentifier" ) .append('('); if ( getCatalog()!=null ) buf.append( getCatalog() + "." ); if ( getSchema()!=null ) buf.append( getSchema()+ "."); buf.append( getName() ).append(')'); return buf.toString(); }
/** Shorthand for {@link getTable(String,String,String)} **/ public Table getTable(TableIdentifier ti) { return dbs.getTable(ti.getSchema(), ti.getCatalog(), ti.getName()); }
public String columnToHibernateTypeName(TableIdentifier table, String columnName, int sqlType, int length, int precision, int scale, boolean nullable, boolean generatedIdentifier) { String preferredHibernateType = JDBCToHibernateTypeHelper.getPreferredHibernateType(sqlType, length, precision, scale, nullable, generatedIdentifier); String location = "<no info>"; if(log.isDebugEnabled()) { String info = " t:" + JDBCToHibernateTypeHelper.getJDBCTypeName( sqlType ) + " l:" + length + " p:" + precision + " s:" + scale + " n:" + nullable + " id:" + generatedIdentifier; if(table!=null) { location = TableNameQualifier.qualify(table.getCatalog(), table.getSchema(), table.getName() ) + "." + columnName + info; } else { location += " Column: " + columnName + info; } } if(preferredHibernateType==null) { log.debug("No default type found for [" + location + "] falling back to [serializable]"); return "serializable"; } else { log.debug("Default type found for [" + location + "] to [" + preferredHibernateType + "]"); return preferredHibernateType; } }
public String columnToHibernateTypeName(TableIdentifier table, String columnName, int sqlType, int length, int precision, int scale, boolean nullable, boolean generatedIdentifier) { String result = null; String location = ""; String info = " t:" + JDBCToHibernateTypeHelper.getJDBCTypeName( sqlType ) + " l:" + length + " p:" + precision + " s:" + scale + " n:" + nullable + " id:" + generatedIdentifier; if(table!=null) { location = TableNameQualifier.qualify(table.getCatalog(), table.getSchema(), table.getName() ) + "." + columnName; } else { location += " Column: " + columnName + info; } if(table!=null && columnName!=null) { result = typeForColumn.get(new TableColumnKey(table, columnName)); if(result!=null) { log.debug("explicit column mapping found for [" + location + "] to [" + result + "]"); return result; } } result = OverrideRepository.this.getPreferredHibernateType(sqlType, length, precision, scale, nullable); if(result==null) { return super.columnToHibernateTypeName(table, columnName, sqlType, length, precision, scale, nullable, generatedIdentifier); } else { log.debug("<type-mapping> found for [" + location + info + "] to [" + result + "]"); return result; } }
private boolean isRelevantFor(TableIdentifier identifier) { if(catalogMatcher.match(identifier.getCatalog() ) ) { if(schemaMatcher.match(identifier.getSchema() ) ) { if(nameMatcher.match(identifier.getName() ) ) { return true; } } } return false; }
String suggestedStrategy = pki.suggestedStrategy; if(suggestedStrategy==null) { suggestedStrategy = collector.getSuggestedIdentifierStrategy( tableIdentifier.getCatalog(), tableIdentifier.getSchema(), tableIdentifier.getName() ); if(suggestedStrategy==null) { suggestedStrategy = "assigned";