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

  • Making http requests using okhttp
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getContentResolver (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • IsNull (org.hamcrest.core)
    Is the value null?
  • 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