congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
UnionSubclass
Code IndexAdd Tabnine to your IDE (free)

How to use
UnionSubclass
in
org.hibernate.mapping

Best Java code snippets using org.hibernate.mapping.UnionSubclass (Showing top 20 results out of 315)

origin: hibernate/hibernate-orm

private void bindUnionSubclassEntities(
    EntitySource entitySource,
    PersistentClass superEntityDescriptor) {
  for ( IdentifiableTypeSource subType : entitySource.getSubTypes() ) {
    final UnionSubclass subEntityDescriptor = new UnionSubclass( superEntityDescriptor, metadataBuildingContext );
    bindUnionSubclassEntity( (SubclassEntitySourceImpl) subType, subEntityDescriptor );
    superEntityDescriptor.addSubclass( subEntityDescriptor );
    entitySource.getLocalMetadataBuildingContext().getMetadataCollector().addEntityBinding( subEntityDescriptor );
  }
}
origin: hibernate/hibernate-orm

private void bindUnionSubclassEntity(
    SubclassEntitySourceImpl entitySource,
    UnionSubclass entityDescriptor) {
  MappingDocument mappingDocument = entitySource.sourceMappingDocument();
  bindBasicEntityValues(
      mappingDocument,
      entitySource,
      entityDescriptor
  );
  final Table primaryTable = bindEntityTableSpecification(
      mappingDocument,
      entitySource.getPrimaryTable(),
      entityDescriptor.getSuperclass().getTable(),
      entitySource,
      entityDescriptor
  );
  entityDescriptor.setTable( primaryTable );
  if ( log.isDebugEnabled() ) {
    log.debugf( "Mapping union-subclass: %s -> %s", entityDescriptor.getEntityName(), primaryTable.getName() );
  }
  // todo : tooling hints
  bindAllEntityAttributes(
      entitySource.sourceMappingDocument(),
      entitySource,
      entityDescriptor
  );
  bindUnionSubclassEntities( entitySource, entityDescriptor );
}
origin: hibernate/hibernate-orm

protected Iterator getNonDuplicatedPropertyIterator() {
  return getPropertyClosureIterator();
}
origin: hibernate/hibernate

public static void bindUnionSubclass(Element node, UnionSubclass unionSubclass,
    Mappings mappings, java.util.Map inheritedMetas) throws MappingException {
  bindClass( node, unionSubclass, mappings, inheritedMetas );
  inheritedMetas = getMetas( node, inheritedMetas, true ); // get meta's from <subclass>
  if ( unionSubclass.getEntityPersisterClass() == null ) {
    unionSubclass.getRootClass().setEntityPersisterClass(
      UnionSubclassEntityPersister.class );
  }
  Attribute schemaNode = node.attribute( "schema" );
  String schema = schemaNode == null ? mappings.getSchemaName() : schemaNode.getValue();
  Attribute catalogNode = node.attribute( "catalog" );
  String catalog = catalogNode == null ? mappings.getCatalogName() : catalogNode.getValue();
  Table mytable = mappings.addDenormalizedTable( 
      schema, 
      catalog, 
      getClassTableName(unionSubclass, node, mappings ), 
      unionSubclass.isAbstract(), 
      getSubselect( node ), 
      unionSubclass.getSuperclass().getTable() );
  unionSubclass.setTable( mytable );
  log.info( "Mapping union-subclass: "
    + unionSubclass.getEntityName()
    + " -> "
    + unionSubclass.getTable().getName() );
  createClassProperties( node, unionSubclass, mappings, inheritedMetas );
}
origin: org.hibernate/com.springsource.org.hibernate

public static void bindUnionSubclass(Element node, UnionSubclass unionSubclass,
    Mappings mappings, java.util.Map inheritedMetas) throws MappingException {
  bindClass( node, unionSubclass, mappings, inheritedMetas );
  inheritedMetas = getMetas( node, inheritedMetas, true ); // get meta's from <subclass>
  Attribute schemaNode = node.attribute( "schema" );
  String schema = schemaNode == null ?
      mappings.getSchemaName() : schemaNode.getValue();
  Attribute catalogNode = node.attribute( "catalog" );
  String catalog = catalogNode == null ?
      mappings.getCatalogName() : catalogNode.getValue();
  Table denormalizedSuperTable = unionSubclass.getSuperclass().getTable();
  Table mytable = mappings.addDenormalizedTable(
      schema,
      catalog,
      getClassTableName(unionSubclass, node, schema, catalog, denormalizedSuperTable, mappings ),
      unionSubclass.isAbstract() != null && unionSubclass.isAbstract().booleanValue(),
      getSubselect( node ),
      denormalizedSuperTable
    );
  unionSubclass.setTable( mytable );
  if ( LOG.isDebugEnabled() ) {
    LOG.debugf( "Mapping union-subclass: %s -> %s", unionSubclass.getEntityName(), unionSubclass.getTable().getName() );
  }
  createClassProperties( node, unionSubclass, mappings, inheritedMetas );
}
origin: hibernate/hibernate-orm

public void validate(Mapping mapping) throws MappingException {
  super.validate(mapping);
  if ( key!=null && !key.isValid(mapping) ) {
    throw new MappingException(
      "subclass key mapping has wrong number of columns: " +
      getEntityName() +
      " type: " +
      key.getType().getName()
    );
  }
}

origin: hibernate/hibernate-orm

public void setTable(Table table) {
  this.table = table;
  getSuperclass().addSubclassTable(table);
}
origin: hibernate/hibernate-orm

public Table getIdentityTable() {
  return getTable();
}

origin: hibernate/hibernate-orm

@Test
public void testProperCallbacks() {
  PersistentClassVisitorValidator vv = new PersistentClassVisitorValidator();
  new RootClass( metadataBuildingContext ).accept( vv );
  new Subclass( new RootClass( metadataBuildingContext ), metadataBuildingContext ).accept( vv );
  new JoinedSubclass( new RootClass( metadataBuildingContext ), metadataBuildingContext ).accept( vv );
  new SingleTableSubclass( new RootClass( metadataBuildingContext ), metadataBuildingContext ).accept( vv );
  new UnionSubclass( new RootClass( metadataBuildingContext ), metadataBuildingContext ).accept( vv );
}
origin: org.hibernate.orm/hibernate-core

private void bindUnionSubclassEntity(
    SubclassEntitySourceImpl entitySource,
    UnionSubclass entityDescriptor) {
  MappingDocument mappingDocument = entitySource.sourceMappingDocument();
  bindBasicEntityValues(
      mappingDocument,
      entitySource,
      entityDescriptor
  );
  final MappedTable primaryTable = bindEntityTableSpecification(
      mappingDocument,
      entitySource.getPrimaryTable(),
      entityDescriptor.getSuperManagedTypeMapping().getMappedTable(),
      entitySource,
      entityDescriptor
  );
  entityDescriptor.setMappedTable( primaryTable );
  if ( log.isDebugEnabled() ) {
    log.debugf( "Mapping union-subclass: %s -> %s", entityDescriptor.getEntityName(), primaryTable.getName() );
  }
  // todo : tooling hints
  bindAllEntityAttributes(
      entitySource.sourceMappingDocument(),
      entitySource,
      entityDescriptor
  );
  bindUnionSubclassEntities( entitySource, entityDescriptor );
}
origin: org.grails/grails-datastore-gorm-hibernate-core

public void bindUnionSubclass(HibernatePersistentEntity subClass, UnionSubclass unionSubclass,
                   Mappings mappings, String sessionFactoryBeanName) throws MappingException {
  Mapping subMapping = getMapping(subClass.getJavaClass());
  if ( unionSubclass.getEntityPersisterClass() == null ) {
    unionSubclass.getRootClass().setEntityPersisterClass(
        UnionSubclassEntityPersister.class );
  }
  String schema = subMapping != null && subMapping.getTable().getSchema() != null ?
      subMapping.getTable().getSchema() : null;
  String catalog = subMapping != null && subMapping.getTable().getCatalog() != null ?
      subMapping.getTable().getCatalog() : null;
  Table denormalizedSuperTable = unionSubclass.getSuperclass().getTable();
  Table mytable = mappings.addDenormalizedTable(
      schema,
      catalog,
      getTableName(subClass, sessionFactoryBeanName),
      unionSubclass.isAbstract() != null && unionSubclass.isAbstract(),
      null,
      denormalizedSuperTable
  );
  unionSubclass.setTable( mytable );
  unionSubclass.setClassName(subClass.getName());
  LOG.info(
      "Mapping union-subclass: " + unionSubclass.getEntityName() +
          " -> " + unionSubclass.getTable().getName()
  );
  createClassProperties(subClass, unionSubclass, mappings, sessionFactoryBeanName);
}
/**
origin: org.hibernate/com.springsource.org.hibernate.core

public static void bindUnionSubclass(Element node, UnionSubclass unionSubclass,
    Mappings mappings, java.util.Map inheritedMetas) throws MappingException {
  bindClass( node, unionSubclass, mappings, inheritedMetas );
  inheritedMetas = getMetas( node, inheritedMetas, true ); // get meta's from <subclass>
  Attribute schemaNode = node.attribute( "schema" );
  String schema = schemaNode == null ?
      mappings.getSchemaName() : schemaNode.getValue();
  Attribute catalogNode = node.attribute( "catalog" );
  String catalog = catalogNode == null ?
      mappings.getCatalogName() : catalogNode.getValue();
  Table denormalizedSuperTable = unionSubclass.getSuperclass().getTable();
  Table mytable = mappings.addDenormalizedTable(
      schema,
      catalog,
      getClassTableName(unionSubclass, node, schema, catalog, denormalizedSuperTable, mappings ),
      unionSubclass.isAbstract() != null && unionSubclass.isAbstract().booleanValue(),
      getSubselect( node ),
      denormalizedSuperTable
    );
  unionSubclass.setTable( mytable );
  if ( LOG.isDebugEnabled() ) {
    LOG.debugf( "Mapping union-subclass: %s -> %s", unionSubclass.getEntityName(), unionSubclass.getTable().getName() );
  }
  createClassProperties( node, unionSubclass, mappings, inheritedMetas );
}
origin: jboss.jboss-embeddable-ejb3/hibernate-all

public void validate(Mapping mapping) throws MappingException {
  super.validate(mapping);
  if ( key!=null && !key.isValid(mapping) ) {
    throw new MappingException(
      "subclass key mapping has wrong number of columns: " +
      getEntityName() +
      " type: " +
      key.getType().getName()
    );
  }
}
 
origin: org.hibernate.orm/hibernate-core

@Override
public void setMappedTable(MappedTable table) {
  this.table = table;
  getSuperclass().addSubclassTable(table);
}
origin: jboss.jboss-embeddable-ejb3/hibernate-all

public Table getIdentityTable() {
  return getTable();
}
 
origin: jboss.jboss-embeddable-ejb3/hibernate-all

public static void bindUnionSubclass(Element node, UnionSubclass unionSubclass,
    Mappings mappings, java.util.Map inheritedMetas) throws MappingException {
  bindClass( node, unionSubclass, mappings, inheritedMetas );
  inheritedMetas = getMetas( node, inheritedMetas, true ); // get meta's from <subclass>
  if ( unionSubclass.getEntityPersisterClass() == null ) {
    unionSubclass.getRootClass().setEntityPersisterClass(
      UnionSubclassEntityPersister.class );
  }
  Attribute schemaNode = node.attribute( "schema" );
  String schema = schemaNode == null ?
      mappings.getSchemaName() : schemaNode.getValue();
  Attribute catalogNode = node.attribute( "catalog" );
  String catalog = catalogNode == null ?
      mappings.getCatalogName() : catalogNode.getValue();
  Table denormalizedSuperTable = unionSubclass.getSuperclass().getTable();
  Table mytable = mappings.addDenormalizedTable(
      schema,
      catalog,
      getClassTableName(unionSubclass, node, schema, catalog, denormalizedSuperTable, mappings ),
      unionSubclass.isAbstract() != null && unionSubclass.isAbstract().booleanValue(),
      getSubselect( node ),
      denormalizedSuperTable
    );
  unionSubclass.setTable( mytable );
  log.info(
      "Mapping union-subclass: " + unionSubclass.getEntityName() +
      " -> " + unionSubclass.getTable().getName()
    );
  createClassProperties( node, unionSubclass, mappings, inheritedMetas );
}
origin: hibernate/hibernate-orm

private static PersistentClass makePersistentClass(
    InheritanceState inheritanceState,
    PersistentClass superEntity,
    MetadataBuildingContext metadataBuildingContext) {
  //we now know what kind of persistent entity it is
  if ( !inheritanceState.hasParents() ) {
    return new RootClass( metadataBuildingContext );
  }
  else if ( InheritanceType.SINGLE_TABLE.equals( inheritanceState.getType() ) ) {
    return new SingleTableSubclass( superEntity, metadataBuildingContext );
  }
  else if ( InheritanceType.JOINED.equals( inheritanceState.getType() ) ) {
    return new JoinedSubclass( superEntity, metadataBuildingContext );
  }
  else if ( InheritanceType.TABLE_PER_CLASS.equals( inheritanceState.getType() ) ) {
    return new UnionSubclass( superEntity, metadataBuildingContext );
  }
  else {
    throw new AssertionFailure( "Unknown inheritance type: " + inheritanceState.getType() );
  }
}
origin: hibernate/hibernate

public void validate(Mapping mapping) throws MappingException {
  super.validate(mapping);
  if ( key!=null && !key.isValid(mapping) ) {
    throw new MappingException(
      "subclass key mapping has wrong number of columns: " +
      getEntityName() +
      " type: " +
      key.getType().getName()
    );
  }
}

origin: org.hibernate/com.springsource.org.hibernate

public void setTable(Table table) {
  this.table = table;
  getSuperclass().addSubclassTable(table);
}
origin: org.hibernate/com.springsource.org.hibernate

public Table getIdentityTable() {
  return getTable();
}

org.hibernate.mappingUnionSubclass

Javadoc

A subclass in a table-per-concrete-class mapping

Most used methods

  • <init>
  • getEntityName
  • getSuperclass
  • getPropertyClosureIterator
  • getTable
  • setTable
  • isAbstract
  • getEntityPersisterClass
  • getRootClass
  • accept
  • getCustomSQLUpdate
  • getCustomSQLUpdateCheckStyle
  • getCustomSQLUpdate,
  • getCustomSQLUpdateCheckStyle,
  • getMappedTable,
  • getSuperManagedTypeMapping,
  • isCustomUpdateCallable,
  • setClassName,
  • setMappedTable

Popular in Java

  • Reactive rest calls using spring rest template
  • compareTo (BigDecimal)
  • getContentResolver (Context)
  • addToBackStack (FragmentTransaction)
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • String (java.lang)
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now