private void checkColumnDuplication() throws MappingException { HashSet cols = new HashSet(); checkColumnDuplication( cols, getKey() ); if ( isIndexed() ) { checkColumnDuplication( cols, ( (IndexedCollection) this ).getIndex() ); } if ( isIdentified() ) { checkColumnDuplication( cols, ( (IdentifierCollection) this ).getIdentifier() ); } if ( !isOneToMany() ) { checkColumnDuplication( cols, getElement() ); } }
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 ); } }
@Override public void doSecondPass(Map persistentClasses) throws org.hibernate.MappingException { bindCollectionTable(); bindCollectionKey(); bindCollectionIdentifier(); bindCollectionIndex(); bindCollectionElement(); createBackReferences(); collectionBinding.createAllKeys(); if ( debugEnabled ) { log.debugf( "Mapped collection : " + getPluralAttributeSource().getAttributeRole().getFullPath() ); log.debugf( " + table -> " + getCollectionBinding().getTable().getName() ); log.debugf( " + key -> " + columns( getCollectionBinding().getKey() ) ); if ( getCollectionBinding().isIndexed() ) { log.debugf( " + index -> " + columns( ( (IndexedCollection) getCollectionBinding() ).getIndex() ) ); } if ( getCollectionBinding().isOneToMany() ) { log.debugf( " + one-to-many -> " + ( (OneToMany) getCollectionBinding().getElement() ).getReferencedEntityName() ); } else { log.debugf( " + element -> " + columns( getCollectionBinding().getElement() ) ); } } }
void doSecondPass(java.util.Map persistentClasses, java.util.Map inheritedMetas) throws MappingException { if ( log.isDebugEnabled() ) log.debug( "Second pass for collection: " + collection.getRole() ); secondPass( persistentClasses, inheritedMetas ); 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 ); } }
private String getReferencedEntityName(Value value) { if(value instanceof ToOne) { return ((ToOne)value).getReferencedEntityName(); } if ( value instanceof Collection ) { Collection collection = ((Collection)value); Value element = collection.getElement(); String elementType = getReferencedEntityName( element ); if(collection.isIndexed()) { //TODO..list/map /*IndexedCollection idxCol = (IndexedCollection) collection; if(!idxCol.isList()) { Value idxElement = idxCol.getIndex(); String indexType = getReferencedEntityName( value ); genericDecl = indexType + "," + elementType; }*/ } return elementType; } if(value instanceof OneToMany) { return ((OneToMany)value).getReferencedEntityName(); } return null; }
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 ); } }
private void createCollectionKeys() { 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); } }
protected void createCollectionKeys() { 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 String getGenericCollectionDeclaration(Collection collection, boolean preferRawTypeNames, ImportContext importContext) { Value element = collection.getElement(); String elementType = importContext.importType(getJavaTypeName(element, preferRawTypeNames)); String genericDecl = elementType; if(collection.isIndexed()) { IndexedCollection idxCol = (IndexedCollection) collection; if(!idxCol.isList()) { Value idxElement = idxCol.getIndex(); String indexType = importContext.importType(getJavaTypeName(idxElement, preferRawTypeNames)); genericDecl = indexType + "," + elementType; } } String decl = "<" + genericDecl + ">"; return decl; }
public String getGenericCollectionDeclaration(Collection collection, boolean preferRawTypeNames, ImportContext importContext) { Value element = collection.getElement(); String elementType = importContext.importType(getJavaTypeName(element, preferRawTypeNames)); String genericDecl = elementType; if(collection.isIndexed()) { IndexedCollection idxCol = (IndexedCollection) collection; if(!idxCol.isList()) { Value idxElement = idxCol.getIndex(); String indexType = importContext.importType(getJavaTypeName(idxElement, preferRawTypeNames)); genericDecl = indexType + "," + elementType; } } String decl = "<" + genericDecl + ">"; return decl; }
private void checkColumnDuplication() throws MappingException { HashSet cols = new HashSet(); checkColumnDuplication( cols, getKey() ); if ( isIndexed() ) { checkColumnDuplication( cols, ( (IndexedCollection) this ).getIndex() ); } if ( isIdentified() ) { checkColumnDuplication( cols, ( (IdentifierCollection) this ).getIdentifier() ); } if ( !isOneToMany() ) { checkColumnDuplication( cols, getElement() ); } }
private void checkColumnDuplication() throws MappingException { HashSet cols = new HashSet(); checkColumnDuplication( cols, getKey().getColumnIterator() ); if ( isIndexed() ) { checkColumnDuplication( cols, ( (IndexedCollection) this ) .getIndex() .getColumnIterator() ); } if ( isIdentified() ) { checkColumnDuplication( cols, ( (IdentifierCollection) this ) .getIdentifier() .getColumnIterator() ); } if ( !isOneToMany() ) { checkColumnDuplication( cols, getElement().getColumnIterator() ); } }
private void checkColumnDuplication() throws MappingException { HashSet cols = new HashSet(); checkColumnDuplication( cols, getKey().getColumnIterator() ); if ( isIndexed() ) { checkColumnDuplication( cols, ( (IndexedCollection) this ) .getIndex() .getColumnIterator() ); } if ( isIdentified() ) { checkColumnDuplication( cols, ( (IdentifierCollection) this ) .getIdentifier() .getColumnIterator() ); } if ( !isOneToMany() ) { checkColumnDuplication( cols, getElement().getColumnIterator() ); } }
private void checkColumnDuplication() throws MappingException { HashSet cols = new HashSet(); checkColumnDuplication( cols, getKey().getColumnIterator() ); if ( isIndexed() ) { checkColumnDuplication( cols, ( (IndexedCollection) this ) .getIndex() .getColumnIterator() ); } if ( isIdentified() ) { checkColumnDuplication( cols, ( (IdentifierCollection) this ) .getIdentifier() .getColumnIterator() ); } if ( !isOneToMany() ) { checkColumnDuplication( cols, getElement().getColumnIterator() ); } }
private void checkColumnDuplication() throws MappingException { HashSet cols = new HashSet(); checkColumnDuplication( cols, getKey().getColumnIterator() ); if ( isIndexed() ) { checkColumnDuplication( cols, ( (IndexedCollection) this ) .getIndex() .getColumnIterator() ); } if ( isIdentified() ) { checkColumnDuplication( cols, ( (IdentifierCollection) this ) .getIdentifier() .getColumnIterator() ); } if ( !isOneToMany() ) { checkColumnDuplication( cols, getElement().getColumnIterator() ); } }
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 ); } }
@Override public void doSecondPass(Map<String, PersistentClass> persistentClasses) throws org.hibernate.MappingException { bindCollectionTable(); bindCollectionKey(); bindCollectionIdentifier(); bindCollectionIndex(); bindCollectionElement(); createBackReferences(); collectionBinding.createAllKeys(); if ( debugEnabled ) { log.debugf( "Mapped collection : " + getPluralAttributeSource().getAttributeRole().getFullPath() ); log.debugf( " + table -> " + getCollectionBinding().getMappedTable().getName() ); log.debugf( " + key -> " + columns( getCollectionBinding().getKey() ) ); if ( getCollectionBinding().isIndexed() ) { log.debugf( " + index -> " + columns( ( (IndexedCollection) getCollectionBinding() ).getIndex() ) ); } if ( getCollectionBinding().isOneToMany() ) { log.debugf( " + one-to-many -> " + ( (OneToMany) getCollectionBinding().getElement() ).getReferencedEntityName() ); } else { log.debugf( " + element -> " + columns( getCollectionBinding().getElement() ) ); } } }