public boolean excludeColumn(TableIdentifier identifier, String columnName) { return excludedColumns.contains(new TableColumnKey(identifier, columnName)); }
public void setExcludedColumn(TableIdentifier tableIdentifier, String columnName) { excludedColumns.add(new TableColumnKey(tableIdentifier, columnName)); }
public void setPropertyNameForColumn(TableIdentifier identifier, String columnName, String property) { if(StringHelper.isNotEmpty(property)) { propertyNameForColumn.put(new TableColumnKey(identifier, columnName), property); } }
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; } }
public void addMetaAttributeInfo(TableIdentifier tableIdentifier, String name, MultiMap map) { if(map!=null && !map.isEmpty()) { columnMetaAttributes.put(new TableColumnKey( tableIdentifier, name ), map); } }
public void setTypeNameForColumn(TableIdentifier identifier, String columnName, String type) { if(StringHelper.isNotEmpty(type)) { typeForColumn.put(new TableColumnKey(identifier, columnName), type); } }
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; } }
protected Map<String, MetaAttribute> columnToMetaAttributes(TableIdentifier tableIdentifier, String column) { MultiMap specific = columnMetaAttributes.get( new TableColumnKey(tableIdentifier, column) ); if(specific!=null && !specific.isEmpty()) { return toMetaAttributes(specific); } return null; }