Examples of JoinedSubclass


Examples of org.hibernate.mapping.JoinedSubclass

 
  public void testNeedsTable(){
    Cfg2HbmTool c2h = new Cfg2HbmTool();
    PersistentClass pc = new RootClass();
    assertTrue(c2h.needsTable(pc));
    assertTrue(c2h.needsTable(new JoinedSubclass(pc)));
    assertTrue(c2h.needsTable(new UnionSubclass(pc)));
    assertFalse(c2h.needsTable(new SingleTableSubclass(pc)));
    assertFalse(c2h.needsTable(new Subclass(pc)));
       
  }
View Full Code Here

Examples of org.hibernate.mapping.JoinedSubclass

    OnDelete onDeleteAnn = clazzToProcess.getAnnotation( OnDelete.class );
    boolean onDeleteAppropriate = false;
    if ( InheritanceType.JOINED.equals( inheritanceState.getType() ) && inheritanceState.hasParents() ) {
      onDeleteAppropriate = true;
      final JoinedSubclass jsc = ( JoinedSubclass ) persistentClass;
      if ( persistentClass.getEntityPersisterClass() == null ) {
        persistentClass.getRootClass().setEntityPersisterClass( JoinedSubclassEntityPersister.class );
      }
      SimpleValue key = new DependantValue( mappings, jsc.getTable(), jsc.getIdentifier() );
      jsc.setKey( key );
      ForeignKey fk = clazzToProcess.getAnnotation( ForeignKey.class );
      if ( fk != null && !BinderHelper.isDefault( fk.name() ) ) {
        key.setForeignKeyName( fk.name() );
      }
      if ( onDeleteAnn != null ) {
View Full Code Here

Examples of org.hibernate.mapping.JoinedSubclass

    }
    else if ( InheritanceType.SINGLE_TABLE.equals( inheritanceState.getType() ) ) {
      persistentClass = new SingleTableSubclass( superEntity );
    }
    else if ( InheritanceType.JOINED.equals( inheritanceState.getType() ) ) {
      persistentClass = new JoinedSubclass( superEntity );
    }
    else if ( InheritanceType.TABLE_PER_CLASS.equals( inheritanceState.getType() ) ) {
      persistentClass = new UnionSubclass( superEntity );
    }
    else {
View Full Code Here

Examples of org.hibernate.mapping.JoinedSubclass

    OnDelete onDeleteAnn = clazzToProcess.getAnnotation( OnDelete.class );
    boolean onDeleteAppropriate = false;
    if ( InheritanceType.JOINED.equals( inheritanceState.getType() ) && inheritanceState.hasParents() ) {
      onDeleteAppropriate = true;
      final JoinedSubclass jsc = ( JoinedSubclass ) persistentClass;
      SimpleValue key = new DependantValue( mappings, jsc.getTable(), jsc.getIdentifier() );
      jsc.setKey( key );
      ForeignKey fk = clazzToProcess.getAnnotation( ForeignKey.class );
      if ( fk != null && !BinderHelper.isEmptyAnnotationValue( fk.name() ) ) {
        key.setForeignKeyName( fk.name() );
      }
      if ( onDeleteAnn != null ) {
View Full Code Here

Examples of org.hibernate.mapping.JoinedSubclass

    }
    else if ( InheritanceType.SINGLE_TABLE.equals( inheritanceState.getType() ) ) {
      persistentClass = new SingleTableSubclass( superEntity );
    }
    else if ( InheritanceType.JOINED.equals( inheritanceState.getType() ) ) {
      persistentClass = new JoinedSubclass( superEntity );
    }
    else if ( InheritanceType.TABLE_PER_CLASS.equals( inheritanceState.getType() ) ) {
      persistentClass = new UnionSubclass( superEntity );
    }
    else {
View Full Code Here

Examples of org.hibernate.mapping.JoinedSubclass

    mappings.addClass( subclass );
  }

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

Examples of org.hibernate.mapping.JoinedSubclass

    mappings.addClass( subclass );
  }

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

Examples of org.hibernate.mapping.JoinedSubclass

    mappings.addClass( subclass );
  }

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

Examples of org.hibernate.mapping.JoinedSubclass

    mappings.addClass( subclass );
  }

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

Examples of org.hibernate.mapping.JoinedSubclass

    OnDelete onDeleteAnn = clazzToProcess.getAnnotation( OnDelete.class );
    boolean onDeleteAppropriate = false;
    if ( InheritanceType.JOINED.equals( inheritanceState.getType() ) && inheritanceState.hasParents() ) {
      onDeleteAppropriate = true;
      final JoinedSubclass jsc = ( JoinedSubclass ) persistentClass;
      SimpleValue key = new DependantValue( mappings, jsc.getTable(), jsc.getIdentifier() );
      jsc.setKey( key );
      ForeignKey fk = clazzToProcess.getAnnotation( ForeignKey.class );
      if ( fk != null && !BinderHelper.isEmptyAnnotationValue( fk.name() ) ) {
        key.setForeignKeyName( fk.name() );
      }
      if ( onDeleteAnn != null ) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.