private void manageIdentityGenerator(Mappings mappings, Table tab, SimpleValue id) { id.setIdentifierGeneratorStrategy(PortofinoIdentityGenerator.class.getName()); //"identity"); Properties params = new Properties(); params.put(PersistentIdentifierGenerator.IDENTIFIER_NORMALIZER, mappings.getObjectNameNormalizer()); if (mappings.getSchemaName() != null) { params.setProperty( PersistentIdentifierGenerator.SCHEMA, mappings.getObjectNameNormalizer().normalizeIdentifierQuoting(mappings.getSchemaName())); } if (mappings.getCatalogName() != null) { params.setProperty( PersistentIdentifierGenerator.CATALOG, mappings.getObjectNameNormalizer().normalizeIdentifierQuoting(mappings.getCatalogName())); } id.setIdentifierGeneratorProperties(params); id.setNullValue(null); }
private void manageIdentityGenerator(Mappings mappings, Table tab, SimpleValue id) { id.setIdentifierGeneratorStrategy(PortofinoIdentityGenerator.class.getName()); //"identity"); Properties params = new Properties(); params.put(PersistentIdentifierGenerator.IDENTIFIER_NORMALIZER, mappings.getObjectNameNormalizer()); if (mappings.getSchemaName() != null) { params.setProperty( PersistentIdentifierGenerator.SCHEMA, mappings.getObjectNameNormalizer().normalizeIdentifierQuoting(mappings.getSchemaName())); } if (mappings.getCatalogName() != null) { params.setProperty( PersistentIdentifierGenerator.CATALOG, mappings.getObjectNameNormalizer().normalizeIdentifierQuoting(mappings.getCatalogName())); } id.setIdentifierGeneratorProperties(params); id.setNullValue(null); }
if ( mappings.getSchemaName() != null ) { params.setProperty( PersistentIdentifierGenerator.SCHEMA, mappings.getSchemaName() );
private static String getJoinedSubClassTableName( GrailsDomainClass sub, PersistentClass model, Table denormalizedSuperTable, Mappings mappings, String sessionFactoryBeanName) { String logicalTableName = StringHelper.unqualify(model.getEntityName()); String physicalTableName = getTableName(sub, sessionFactoryBeanName); mappings.addTableBinding(mappings.getSchemaName(), mappings.getCatalogName(), logicalTableName, physicalTableName, denormalizedSuperTable); return physicalTableName; }
protected String getJoinedSubClassTableName( HibernatePersistentEntity sub, PersistentClass model, Table denormalizedSuperTable, Mappings mappings, String sessionFactoryBeanName) { String logicalTableName = unqualify(model.getEntityName()); String physicalTableName = getTableName(sub, sessionFactoryBeanName); mappings.addTableBinding(mappings.getSchemaName(), mappings.getCatalogName(), logicalTableName, physicalTableName, denormalizedSuperTable); return physicalTableName; }
if ( mappings.getSchemaName() != null ) { params.setProperty( PersistentIdentifierGenerator.SCHEMA, mappings.getObjectNameNormalizer().normalizeIdentifierQuoting( mappings.getSchemaName() ) );
if ( mappings.getSchemaName() != null ) { params.setProperty( PersistentIdentifierGenerator.SCHEMA, mappings.getObjectNameNormalizer().normalizeIdentifierQuoting( mappings.getSchemaName() ) );
if (mappings.getSchemaName() != null) { params.setProperty(PersistentIdentifierGenerator.SCHEMA, mappings.getSchemaName());
mappings.getSchemaName(), mappings.getCatalogName(), getJoinedSubClassTableName(sub, joinedSubclass, null, mappings, sessionFactoryBeanName), null, false);
mappings.getSchemaName(), mappings.getCatalogName(), getJoinedSubClassTableName(sub, joinedSubclass, null, mappings, sessionFactoryBeanName), null, false);
public static void bindUnionSubclass(Element node, UnionSubclass unionSubclass, Mappings mappings, java.util.Map inheritedMetas) throws MappingException { bindClass( node, unionSubclass, mappings, inheritedMetas ); inheritedMetas = getMetas( node, inheritedMetas, true ); // get meta's from <subclass> if ( unionSubclass.getEntityPersisterClass() == null ) { unionSubclass.getRootClass().setEntityPersisterClass( UnionSubclassEntityPersister.class ); } Attribute schemaNode = node.attribute( "schema" ); String schema = schemaNode == null ? mappings.getSchemaName() : schemaNode.getValue(); Attribute catalogNode = node.attribute( "catalog" ); String catalog = catalogNode == null ? mappings.getCatalogName() : catalogNode.getValue(); Table denormalizedSuperTable = unionSubclass.getSuperclass().getTable(); Table mytable = mappings.addDenormalizedTable( schema, catalog, getClassTableName(unionSubclass, node, schema, catalog, denormalizedSuperTable, mappings ), unionSubclass.isAbstract() != null && unionSubclass.isAbstract().booleanValue(), getSubselect( node ), denormalizedSuperTable ); unionSubclass.setTable( mytable ); log.info( "Mapping union-subclass: " + unionSubclass.getEntityName() + " -> " + unionSubclass.getTable().getName() ); createClassProperties( node, unionSubclass, mappings, inheritedMetas ); }
String schema = schemaNode == null ? mappings.getSchemaName() : schemaNode.getValue();
mappings.getSchemaName() : schemaNode.getValue();
private static void bindCollectionTable(GrailsDomainClassProperty property, Mappings mappings, Collection collection, Table ownerTable, String sessionFactoryBeanName) { String prefix = ownerTable.getSchema(); PropertyConfig config = getPropertyConfig(property); JoinTable jt = config != null ? config.getJoinTable() : null; NamingStrategy namingStrategy = getNamingStrategy(sessionFactoryBeanName); String tableName = (prefix == null ? "" : prefix + '.') + (jt != null && jt.getName() != null ? jt.getName() : namingStrategy.tableName(calculateTableForMany(property, sessionFactoryBeanName))); String schemaName = mappings.getSchemaName(); String catalogName = mappings.getCatalogName(); if(jt != null) { if(jt.getSchema() != null) { schemaName = jt.getSchema(); } if(jt.getCatalog() != null) { catalogName = jt.getCatalog(); } } collection.setCollectionTable(mappings.addTable( schemaName, catalogName, tableName, null, false)); }
mappings.getSchemaName() : schemaNode.getValue();
protected void bindCollectionTable(ToMany property, Mappings mappings, Collection collection, Table ownerTable, String sessionFactoryBeanName) { String owningTableSchema = ownerTable.getSchema(); PropertyConfig config = getPropertyConfig(property); JoinTable jt = config != null ? config.getJoinTable() : null; NamingStrategy namingStrategy = getNamingStrategy(sessionFactoryBeanName); String tableName = (jt != null && jt.getName() != null ? jt.getName() : namingStrategy.tableName(calculateTableForMany(property, sessionFactoryBeanName))); String schemaName = mappings.getSchemaName(); String catalogName = mappings.getCatalogName(); if(jt != null) { if(jt.getSchema() != null) { schemaName = jt.getSchema(); } if(jt.getCatalog() != null) { catalogName = jt.getCatalog(); } } if(schemaName == null && owningTableSchema != null) { schemaName = owningTableSchema; } collection.setCollectionTable(mappings.addTable( schemaName, catalogName, tableName, null, false)); }
public static void bindUnionSubclass(Element node, UnionSubclass unionSubclass, Mappings mappings, java.util.Map inheritedMetas) throws MappingException { bindClass( node, unionSubclass, mappings, inheritedMetas ); inheritedMetas = getMetas( node, inheritedMetas, true ); // get meta's from <subclass> Attribute schemaNode = node.attribute( "schema" ); String schema = schemaNode == null ? mappings.getSchemaName() : schemaNode.getValue(); Attribute catalogNode = node.attribute( "catalog" ); String catalog = catalogNode == null ? mappings.getCatalogName() : catalogNode.getValue(); Table denormalizedSuperTable = unionSubclass.getSuperclass().getTable(); Table mytable = mappings.addDenormalizedTable( schema, catalog, getClassTableName(unionSubclass, node, schema, catalog, denormalizedSuperTable, mappings ), unionSubclass.isAbstract() != null && unionSubclass.isAbstract().booleanValue(), getSubselect( node ), denormalizedSuperTable ); unionSubclass.setTable( mytable ); if ( LOG.isDebugEnabled() ) { LOG.debugf( "Mapping union-subclass: %s -> %s", unionSubclass.getEntityName(), unionSubclass.getTable().getName() ); } createClassProperties( node, unionSubclass, mappings, inheritedMetas ); }
mappings.getSchemaName() : schemaNode.getValue();
public static void bindUnionSubclass(Element node, UnionSubclass unionSubclass, Mappings mappings, java.util.Map inheritedMetas) throws MappingException { bindClass( node, unionSubclass, mappings, inheritedMetas ); inheritedMetas = getMetas( node, inheritedMetas, true ); // get meta's from <subclass> Attribute schemaNode = node.attribute( "schema" ); String schema = schemaNode == null ? mappings.getSchemaName() : schemaNode.getValue(); Attribute catalogNode = node.attribute( "catalog" ); String catalog = catalogNode == null ? mappings.getCatalogName() : catalogNode.getValue(); Table denormalizedSuperTable = unionSubclass.getSuperclass().getTable(); Table mytable = mappings.addDenormalizedTable( schema, catalog, getClassTableName(unionSubclass, node, schema, catalog, denormalizedSuperTable, mappings ), unionSubclass.isAbstract() != null && unionSubclass.isAbstract().booleanValue(), getSubselect( node ), denormalizedSuperTable ); unionSubclass.setTable( mytable ); if ( LOG.isDebugEnabled() ) { LOG.debugf( "Mapping union-subclass: %s -> %s", unionSubclass.getEntityName(), unionSubclass.getTable().getName() ); } createClassProperties( node, unionSubclass, mappings, inheritedMetas ); }
public static void bindUnionSubclass(Element node, UnionSubclass unionSubclass, Mappings mappings, java.util.Map inheritedMetas) throws MappingException { bindClass( node, unionSubclass, mappings, inheritedMetas ); inheritedMetas = getMetas( node, inheritedMetas, true ); // get meta's from <subclass> if ( unionSubclass.getEntityPersisterClass() == null ) { unionSubclass.getRootClass().setEntityPersisterClass( UnionSubclassEntityPersister.class ); } Attribute schemaNode = node.attribute( "schema" ); String schema = schemaNode == null ? mappings.getSchemaName() : schemaNode.getValue(); Attribute catalogNode = node.attribute( "catalog" ); String catalog = catalogNode == null ? mappings.getCatalogName() : catalogNode.getValue(); Table mytable = mappings.addDenormalizedTable( schema, catalog, getClassTableName(unionSubclass, node, mappings ), unionSubclass.isAbstract(), getSubselect( node ), unionSubclass.getSuperclass().getTable() ); unionSubclass.setTable( mytable ); log.info( "Mapping union-subclass: " + unionSubclass.getEntityName() + " -> " + unionSubclass.getTable().getName() ); createClassProperties( node, unionSubclass, mappings, inheritedMetas ); }