public void addSubclass(Subclass subclass) throws MappingException { // inheritance cycle detection (paranoid check) PersistentClass superclass = getSuperclass(); while ( superclass != null ) { if ( subclass.getEntityName().equals( superclass.getEntityName() ) ) { throw new MappingException( "Circular inheritance mapping detected: " + subclass.getEntityName() + " will have it self as superclass when extending " + getEntityName() ); } superclass = superclass.getSuperclass(); } subclasses.add( subclass ); }
if ( !subclassProxy.isInterface() ) { throw new MappingException( "proxy must be either an interface, or the class itself: " + subclass.getEntityName() );
while ( iter.hasNext() ) { Subclass sc = (Subclass) iter.next(); subclassClosure[k++] = sc.getEntityName(); subclassByDiscriminatorValue.put( sc.getSubclassId(), sc.getEntityName() );
while ( iter.hasNext() ) { Subclass sc = (Subclass) iter.next(); subclassClosure[k] = sc.getEntityName(); try { if ( persistentClass.isPolymorphic() ) { subclassesByDiscriminatorValue.put( discriminatorValue, sc.getEntityName() ); discriminatorValues[k] = discriminatorValue.toString(); int id = getTableId(
while ( iter.hasNext() ) { Subclass sc = (Subclass) iter.next(); subclassClosure[k++] = sc.getEntityName(); if ( sc.isDiscriminatorValueNull() ) { addSubclassByDiscriminatorValue( NULL_DISCRIMINATOR, sc.getEntityName() ); addSubclassByDiscriminatorValue( NOT_NULL_DISCRIMINATOR, sc.getEntityName() ); addSubclassByDiscriminatorValue( dtype.stringToObject( sc.getDiscriminatorValue() ), sc.getEntityName() );
private static Map<Object, String> subclassesByValue(final PersistentClass persistentClass, Object value, Type type) { Map<Object, String> subclassesByDsicriminator = new HashMap<Object, String>(); subclassesByDsicriminator.put( value, persistentClass.getEntityName() ); if ( persistentClass.isPolymorphic() ) { @SuppressWarnings("unchecked") Iterator<Subclass> iter = persistentClass.getSubclassIterator(); while ( iter.hasNext() ) { Subclass sc = iter.next(); subclassesByDsicriminator.put( value( sc, type ), sc.getEntityName() ); } } return subclassesByDsicriminator; }
private static Map<Object, String> subclassesByValue(final PersistentClass persistentClass, Object value) { Map<Object, String> subclassesByDiscriminator = new HashMap<Object, String>(); subclassesByDiscriminator.put( persistentClass.getSubclassId(), persistentClass.getEntityName() ); if ( persistentClass.isPolymorphic() ) { @SuppressWarnings("unchecked") Iterator<Subclass> iter = persistentClass.getSubclassIterator(); while ( iter.hasNext() ) { Subclass sc = iter.next(); subclassesByDiscriminator.put( sc.getSubclassId(), sc.getEntityName() ); } } return subclassesByDiscriminator; }
public void addSubclass(Subclass subclass) throws MappingException { // inheritance cycle detection (paranoid check) PersistentClass superclass = getSuperclass(); while (superclass!=null) { if( subclass.getEntityName().equals( superclass.getEntityName() ) ) { throw new MappingException( "Circular inheritance mapping detected: " + subclass.getEntityName() + " will have it self as superclass when extending " + getEntityName() ); } superclass = superclass.getSuperclass(); } subclasses.add(subclass); }
public void addSubclass(Subclass subclass) throws MappingException { // inheritance cycle detection (paranoid check) PersistentClass superclass = getSuperclass(); while (superclass!=null) { if( subclass.getEntityName().equals( superclass.getEntityName() ) ) { throw new MappingException( "Circular inheritance mapping detected: " + subclass.getEntityName() + " will have it self as superclass when extending " + getEntityName() ); } superclass = superclass.getSuperclass(); } subclasses.add(subclass); }
public void addSubclass(Subclass subclass) throws MappingException { // inheritance cycle detection (paranoid check) PersistentClass superclass = getSuperclass(); while (superclass!=null) { if( subclass.getEntityName().equals( superclass.getEntityName() ) ) { throw new MappingException( "Circular inheritance mapping detected: " + subclass.getEntityName() + " will have it self as superclass when extending " + getEntityName() ); } superclass = superclass.getSuperclass(); } subclasses.add(subclass); }
public void addSubclass(Subclass subclass) throws MappingException { // inheritance cycle detection (paranoid check) PersistentClass superclass = getSuperclass(); while (superclass!=null) { if( subclass.getEntityName().equals( superclass.getEntityName() ) ) { throw new MappingException( "Circular inheritance mapping detected: " + subclass.getEntityName() + " will have it self as superclass when extending " + getEntityName() ); } superclass = superclass.getSuperclass(); } subclasses.add(subclass); }
/** * Binds a sub-class using table-per-hierarchy inheritance mapping * * @param sub The Grails domain class instance representing the sub-class * @param subClass The Hibernate SubClass instance * @param mappings The mappings instance */ private static void bindSubClass(GrailsDomainClass sub, Subclass subClass, Mappings mappings, String sessionFactoryBeanName) { bindClass(sub, subClass, mappings); if (subClass.getEntityPersisterClass() == null) { subClass.getRootClass() .setEntityPersisterClass(GroovyAwareSingleTableEntityPersister.class); // .setEntityPersisterClass(SingleTableEntityPersister.class); } if (LOG.isDebugEnabled()) LOG.debug("Mapping subclass: " + subClass.getEntityName() + " -> " + subClass.getTable().getName()); // properties createClassProperties(sub, subClass, mappings, sessionFactoryBeanName); }
/** * Binds a sub-class using table-per-hierarchy inheritance mapping * * @param sub The Grails domain class instance representing the sub-class * @param subClass The Hibernate SubClass instance * @param mappings The mappings instance */ protected void bindSubClass(HibernatePersistentEntity sub, Subclass subClass, Mappings mappings, String sessionFactoryBeanName) { bindClass(sub, subClass, mappings); if (subClass.getEntityPersisterClass() == null) { subClass.getRootClass().setEntityPersisterClass(getGroovyAwareSingleTableEntityPersisterClass()); } if (LOG.isDebugEnabled()) LOG.debug("Mapping subclass: " + subClass.getEntityName() + " -> " + subClass.getTable().getName()); // properties createClassProperties(sub, subClass, mappings, sessionFactoryBeanName); }
public static void bindSubclass(Element node, Subclass subclass, Mappings mappings, java.util.Map inheritedMetas) throws MappingException { bindClass( node, subclass, mappings, inheritedMetas ); inheritedMetas = getMetas( node, inheritedMetas, true ); // get meta's from <subclass> if ( subclass.getEntityPersisterClass() == null ) { subclass.getRootClass().setEntityPersisterClass( SingleTableEntityPersister.class ); } log.info( "Mapping subclass: " + subclass.getEntityName() + " -> " + subclass.getTable().getName() ); // properties createClassProperties( node, subclass, mappings, inheritedMetas ); }
public static void bindSubclass(Element node, Subclass subclass, Mappings mappings, java.util.Map inheritedMetas) throws MappingException { bindClass( node, subclass, mappings, inheritedMetas ); inheritedMetas = getMetas( node, inheritedMetas, true ); // get meta's from <subclass> if ( subclass.getEntityPersisterClass() == null ) { subclass.getRootClass() .setEntityPersisterClass( SingleTableEntityPersister.class ); } log.info( "Mapping subclass: " + subclass.getEntityName() + " -> " + subclass.getTable().getName() ); // properties createClassProperties( node, subclass, mappings, inheritedMetas ); }
throw new MappingException( "proxy must be either an interface, or the class itself: " + subclass.getEntityName() );
public static void bindSubclass(Element node, Subclass subclass, Mappings mappings, java.util.Map inheritedMetas) throws MappingException { bindClass( node, subclass, mappings, inheritedMetas ); inheritedMetas = getMetas( node, inheritedMetas, true ); // get meta's from <subclass> if ( LOG.isDebugEnabled() ) { LOG.debugf( "Mapping subclass: %s -> %s", subclass.getEntityName(), subclass.getTable().getName() ); } // properties createClassProperties( node, subclass, mappings, inheritedMetas ); }
public static void bindSubclass(Element node, Subclass subclass, Mappings mappings, java.util.Map inheritedMetas) throws MappingException { bindClass( node, subclass, mappings, inheritedMetas ); inheritedMetas = getMetas( node, inheritedMetas, true ); // get meta's from <subclass> if ( LOG.isDebugEnabled() ) { LOG.debugf( "Mapping subclass: %s -> %s", subclass.getEntityName(), subclass.getTable().getName() ); } // properties createClassProperties( node, subclass, mappings, inheritedMetas ); }
if ( !subclassProxy.isInterface() ) { throw new MappingException( "proxy must be either an interface, or the class itself: " + subclass.getEntityName() );
while ( iter.hasNext() ) { Subclass sc = (Subclass) iter.next(); subclassClosure[k++] = sc.getEntityName(); subclassByDiscriminatorValue.put( new Integer( sc.getSubclassId() ), sc.getEntityName() );