public void doSecondPass(java.util.Map persistentClasses) throws MappingException { final boolean debugEnabled = LOG.isDebugEnabled(); if ( debugEnabled ) { LOG.debugf( "Second pass for collection: %s", collection.getRole() ); } secondPass( persistentClasses, localInheritedMetas ); // using local since the inheritedMetas at this point is not the correct map since it is always the empty map collection.createAllKeys(); if ( debugEnabled ) { String msg = "Mapped collection key: " + columns( collection.getKey() ); if ( collection.isIndexed() ) msg += ", index: " + columns( ( (IndexedCollection) collection ).getIndex() ); if ( collection.isOneToMany() ) { msg += ", one-to-many: " + ( (OneToMany) collection.getElement() ).getReferencedEntityName(); } else { msg += ", element: " + columns( collection.getElement() ); } LOG.debug( msg ); } }
@SuppressWarnings("rawtypes") public void doSecondPass(Map persistentClasses) throws MappingException { Value element = collection.getElement(); DependantValue elementDependantValue = null; String oldElementForeignKeyName = null; if(element instanceof DependantValue) { elementDependantValue = (DependantValue)element; oldElementForeignKeyName = elementDependantValue.getForeignKeyName(); elementDependantValue.setForeignKeyName("none"); // Workaround to avoid DependantValue to create foreignkey just because reference columns are not the same + no need to create keys already in the db! } Value key = collection.getKey(); DependantValue keyDependantValue = null; String oldKeyForeignKeyName = null; if (key instanceof DependantValue) { keyDependantValue = (DependantValue)key; oldKeyForeignKeyName = keyDependantValue.getForeignKeyName(); keyDependantValue.setForeignKeyName("none"); } super.doSecondPass(persistentClasses); if(elementDependantValue!=null) { elementDependantValue.setForeignKeyName(oldElementForeignKeyName); } if (keyDependantValue != null) { keyDependantValue.setForeignKeyName(oldKeyForeignKeyName); } }
@SuppressWarnings("rawtypes") public void doSecondPass(Map persistentClasses) throws MappingException { Value element = getCollection().getElement(); DependantValue elementDependantValue = null; String oldElementForeignKeyName = null; if(element instanceof DependantValue) { elementDependantValue = (DependantValue)element; oldElementForeignKeyName = elementDependantValue.getForeignKeyName(); elementDependantValue.setForeignKeyName("none"); // Workaround to avoid DependantValue to create foreignkey just because reference columns are not the same + no need to create keys already in the db! } Value key = getCollection().getKey(); DependantValue keyDependantValue = null; String oldKeyForeignKeyName = null; if (key instanceof DependantValue) { keyDependantValue = (DependantValue)key; oldKeyForeignKeyName = keyDependantValue.getForeignKeyName(); keyDependantValue.setForeignKeyName("none"); } super.doSecondPass(persistentClasses); if(elementDependantValue!=null) { elementDependantValue.setForeignKeyName(oldElementForeignKeyName); } if (keyDependantValue != null) { keyDependantValue.setForeignKeyName(oldKeyForeignKeyName); } }
public void doSecondPass(java.util.Map persistentClasses) throws MappingException { if ( log.isDebugEnabled() ) log.debug( "Second pass for collection: " + collection.getRole() ); secondPass( persistentClasses, localInheritedMetas ); // using local since the inheritedMetas at this point is not the correct map since it is always the empty map collection.createAllKeys(); if ( log.isDebugEnabled() ) { String msg = "Mapped collection key: " + columns( collection.getKey() ); if ( collection.isIndexed() ) msg += ", index: " + columns( ( (IndexedCollection) collection ).getIndex() ); if ( collection.isOneToMany() ) { msg += ", one-to-many: " + ( (OneToMany) collection.getElement() ).getReferencedEntityName(); } else { msg += ", element: " + columns( collection.getElement() ); } log.debug( msg ); } }
public void doSecondPass(java.util.Map persistentClasses) throws MappingException { LOG.debugf( "Second pass for collection: %s", collection.getRole() ); secondPass( persistentClasses, localInheritedMetas ); // using local since the inheritedMetas at this point is not the correct map since it is always the empty map collection.createAllKeys(); if ( LOG.isDebugEnabled() ) { String msg = "Mapped collection key: " + columns( collection.getKey() ); if ( collection.isIndexed() ) msg += ", index: " + columns( ( (IndexedCollection) collection ).getIndex() ); if ( collection.isOneToMany() ) { msg += ", one-to-many: " + ( (OneToMany) collection.getElement() ).getReferencedEntityName(); } else { msg += ", element: " + columns( collection.getElement() ); } LOG.debug( msg ); } }
public void doSecondPass(java.util.Map persistentClasses) throws MappingException { LOG.debugf( "Second pass for collection: %s", collection.getRole() ); secondPass( persistentClasses, localInheritedMetas ); // using local since the inheritedMetas at this point is not the correct map since it is always the empty map collection.createAllKeys(); if ( LOG.isDebugEnabled() ) { String msg = "Mapped collection key: " + columns( collection.getKey() ); if ( collection.isIndexed() ) msg += ", index: " + columns( ( (IndexedCollection) collection ).getIndex() ); if ( collection.isOneToMany() ) { msg += ", one-to-many: " + ( (OneToMany) collection.getElement() ).getReferencedEntityName(); } else { msg += ", element: " + columns( collection.getElement() ); } LOG.debug( msg ); } }
public void doSecondPass(java.util.Map<String, PersistentClass> persistentClasses) throws MappingException { final boolean debugEnabled = LOG.isDebugEnabled(); if ( debugEnabled ) { LOG.debugf( "Second pass for collection: %s", collection.getRole() ); } secondPass( persistentClasses, localInheritedMetas ); // using local since the inheritedMetas at this point is not the correct map since it is always the empty map collection.createAllKeys(); if ( debugEnabled ) { String msg = "Mapped collection key: " + columns( collection.getKey() ); if ( collection.isIndexed() ) msg += ", index: " + columns( ( (IndexedCollection) collection ).getIndex() ); if ( collection.isOneToMany() ) { msg += ", one-to-many: " + ( (OneToMany) collection.getElement() ).getReferencedEntityName(); } else { msg += ", element: " + columns( collection.getElement() ); } LOG.debug( msg ); } }