Package org.hibernate.mapping

Examples of org.hibernate.mapping.Subclass


    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;
  }
View Full Code Here


    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;
  }
View Full Code Here

    assertThat( resolver.getEntityPersisterClass( rootClass ) ).isEqualTo( SingleTableOgmEntityPersister.class );
  }

  @Test
  public void testSinglePersistentClassTableStrategy() throws Exception {
    Subclass subclass = new SingleTableSubclass( new RootClass() );
    assertThat( resolver.getEntityPersisterClass( subclass ) ).isEqualTo( SingleTableOgmEntityPersister.class );
  }
View Full Code Here

    assertThat( resolver.getEntityPersisterClass( subclass ) ).isEqualTo( SingleTableOgmEntityPersister.class );
  }

  @Test
  public void testTablePerClassPersistentSubclassStrategy() throws Exception {
    Subclass subclass = new UnionSubclass( new RootClass() );
    assertThat( resolver.getEntityPersisterClass( subclass ) ).isEqualTo( UnionSubclassOgmEntityPersister.class );
  }
View Full Code Here

    assertThat( resolver.getEntityPersisterClass( subclass ) ).isEqualTo( UnionSubclassOgmEntityPersister.class );
  }

  @Test(expected = UnsupportedOperationException.class)
  public void testPersistenceClassSubclassJoinedStrategy() throws Exception {
    Subclass subclass = new JoinedSubclass( new RootClass() );
    resolver.getEntityPersisterClass( subclass );
  }
View Full Code Here

    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;
  }
View Full Code Here

    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;
  }
View Full Code Here

    mappings.addClass( subclass );
  }

  private static void handleSubclass(PersistentClass model, Mappings mappings, Element subnode,
      java.util.Map inheritedMetas) throws MappingException {
    Subclass subclass = new SingleTableSubclass( model );
    bindSubclass( subnode, subclass, mappings, inheritedMetas );
    model.addSubclass( subclass );
    mappings.addClass( subclass );
  }
View Full Code Here

    // SUBCLASSES
    if ( persistentClass.isPolymorphic() ) {
      iter = persistentClass.getSubclassIterator();
      int k=1;
      while ( iter.hasNext() ) {
        Subclass sc = (Subclass) iter.next();
        subclassClosure[k++] = sc.getEntityName();
        if ( sc.isDiscriminatorValueNull() ) {
          subclassesByDiscriminatorValue.put( NULL_DISCRIMINATOR, sc.getEntityName() );
        }
        else if ( sc.isDiscriminatorValueNotNull() ) {
          subclassesByDiscriminatorValue.put( NOT_NULL_DISCRIMINATOR, sc.getEntityName() );
        }
        else {
          try {
            DiscriminatorType dtype = (DiscriminatorType) discriminatorType;
            subclassesByDiscriminatorValue.put(
              dtype.stringToObject( sc.getDiscriminatorValue() ),
              sc.getEntityName()
            );
          }
          catch (ClassCastException cce) {
            throw new MappingException("Illegal discriminator type: " + discriminatorType.getName() );
          }
View Full Code Here

    );
    if ( persistentClass.isPolymorphic() ) {
      Iterator iter = persistentClass.getSubclassIterator();
      int k=1;
      while ( iter.hasNext() ) {
        Subclass sc = (Subclass) iter.next();
        subclassClosure[k++] = sc.getEntityName();
        subclassByDiscriminatorValue.put( new Integer( sc.getSubclassId() ), sc.getEntityName() );
      }
    }
   
    //SPACES
    //TODO: i'm not sure, but perhaps we should exclude
View Full Code Here

TOP

Related Classes of org.hibernate.mapping.Subclass

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.