Tabnine Logo
Join
Code IndexAdd Tabnine to your IDE (free)

How to use
Join
in
org.hibernate.mapping

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

origin: hibernate/hibernate-orm

while ( joinIter.hasNext() ) {
  Join join = (Join) joinIter.next();
  qualifiedTableNames[j] = determineTableName( join.getTable(), jdbcEnvironment );
  isInverseTable[j] = join.isInverse();
  isNullableTable[j] = join.isOptional()
      || creationContext.getSessionFactory()
          .getSessionFactoryOptions()
          .getJpaCompliance()
          .isJpaCacheComplianceEnabled();
  cascadeDeleteEnabled[j] = join.getKey().isCascadeDeleteEnabled() &&
      factory.getDialect().supportsCascadeDelete();
  customSQLInsert[j] = join.getCustomSQLInsert();
  insertCallable[j] = customSQLInsert[j] != null && join.isCustomInsertCallable();
  insertResultCheckStyles[j] = join.getCustomSQLInsertCheckStyle() == null
      ? ExecuteUpdateResultCheckStyle.determineDefault( customSQLInsert[j], insertCallable[j] )
      : join.getCustomSQLInsertCheckStyle();
  customSQLUpdate[j] = join.getCustomSQLUpdate();
  updateCallable[j] = customSQLUpdate[j] != null && join.isCustomUpdateCallable();
  updateResultCheckStyles[j] = join.getCustomSQLUpdateCheckStyle() == null
      ? ExecuteUpdateResultCheckStyle.determineDefault( customSQLUpdate[j], updateCallable[j] )
      : join.getCustomSQLUpdateCheckStyle();
  customSQLDelete[j] = join.getCustomSQLDelete();
  deleteCallable[j] = customSQLDelete[j] != null && join.isCustomDeleteCallable();
  deleteResultCheckStyles[j] = join.getCustomSQLDeleteCheckStyle() == null
      ? ExecuteUpdateResultCheckStyle.determineDefault( customSQLDelete[j], deleteCallable[j] )
      : join.getCustomSQLDeleteCheckStyle();
  Iterator iter = join.getKey().getColumnIterator();
origin: hibernate/hibernate-orm

if ( !checkPropertiesAudited( join.getPropertyIterator(), auditingData ) ) {
  continue;
final String originalTableName = join.getTable().getName();
String auditTableName = auditingData.getSecondaryTableDictionary().get( originalTableName );
if ( auditTableName == null ) {
final String schema = getSchema( auditingData.getAuditTable().schema(), join.getTable() );
final String catalog = getCatalog( auditingData.getAuditTable().catalog(), join.getTable() );
if ( join.isOptional() ) {
  joinElement.addAttribute( "optional", "true" );
if ( join.isInverse() ) {
  joinElement.addAttribute( "inverse", "true" );
MetadataTools.addColumns( joinKey, join.getKey().getColumnIterator() );
MetadataTools.addColumn( joinKey, verEntCfg.getRevisionFieldName(), null, null, null, null, null, null );
origin: hibernate/hibernate-orm

Join join = new Join();
join.setPersistentClass( persistentClass );
join.setTable( originalJoin.getTable() );
join.setInverse( true );
SimpleValue key = new DependantValue( buildingContext, join.getTable(), persistentClass.getIdentifier() );
join.setKey( key );
join.setSequentialSelect( false );
join.setOptional( true ); //perhaps not quite per-spec, but a Good Thing anyway
key.setCascadeDeleteEnabled( false );
Iterator mappedByColumns = otherSideProperty.getValue().getColumnIterator();
origin: hibernate/hibernate-orm

public Component(MetadataBuildingContext metadata, Join join) throws MappingException {
  this( metadata, join.getTable(), join.getPersistentClass() );
}
origin: hibernate/hibernate-orm

private void bindJoinToPersistentClass(Join join, Ejb3JoinColumn[] ejb3JoinColumns, MetadataBuildingContext buildingContext) {
  SimpleValue key = new DependantValue( buildingContext, join.getTable(), persistentClass.getIdentifier() );
  join.setKey( key );
  setFKNameIfDefined( join );
  key.setCascadeDeleteEnabled( false );
  TableBinder.bindFk( persistentClass, null, ejb3JoinColumns, key, false, buildingContext );
  join.createPrimaryKey();
  join.createForeignKey();
  persistentClass.addJoin( join );
}
origin: hibernate/hibernate-orm

private void addPropertyToJoin(Property prop, XClass declaringClass, Join join) {
  if ( declaringClass != null ) {
    final InheritanceState inheritanceState = inheritanceStatePerClass.get( declaringClass );
    if ( inheritanceState == null ) {
      throw new AssertionFailure(
          "Declaring class is not found in the inheritance state hierarchy: " + declaringClass
      );
    }
    if ( inheritanceState.isEmbeddableSuperclass() ) {
      join.addMappedsuperclassProperty(prop);
      addPropertyToMappedSuperclass( prop, declaringClass );
    }
    else {
      join.addProperty( prop );
    }
  }
  else {
    join.addProperty( prop );
  }
}
origin: hibernate/hibernate-orm

Join join = new Join();
join.setPersistentClass( persistentClass );
join.setTable( table );
LOG.debugf( "Adding secondary table to entity %s -> %s", persistentClass.getEntityName(), join.getTable().getName() );
org.hibernate.annotations.Table matchingTable = findMatchingComplimentTableAnnotation( join );
if ( matchingTable != null ) {
  join.setSequentialSelect( FetchMode.JOIN != matchingTable.fetch() );
  join.setInverse( matchingTable.inverse() );
  join.setOptional( matchingTable.optional() );
  if ( !BinderHelper.isEmptyAnnotationValue( matchingTable.sqlInsert().sql() ) ) {
    join.setCustomSQLInsert( matchingTable.sqlInsert().sql().trim(),
        matchingTable.sqlInsert().callable(),
        ExecuteUpdateResultCheckStyle.fromExternalName(
    join.setCustomSQLUpdate( matchingTable.sqlUpdate().sql().trim(),
        matchingTable.sqlUpdate().callable(),
        ExecuteUpdateResultCheckStyle.fromExternalName(
    join.setCustomSQLDelete( matchingTable.sqlDelete().sql().trim(),
        matchingTable.sqlDelete().callable(),
        ExecuteUpdateResultCheckStyle.fromExternalName(
  join.setSequentialSelect( false );
  join.setInverse( false );
  join.setOptional( true ); //perhaps not quite per-spec, but a Good Thing anyway
origin: hibernate/hibernate

PersistentClass persistentClass = join.getPersistentClass();
String path = persistentClass.getEntityName();
  getSubselect( node ), 
  false );
join.setTable( table );
bindComment(table, node);
  join.setSequentialSelect( "select".equals( fetchNode.getValue() ) );
if ( invNode != null ) join.setInverse( "true".equals( invNode.getValue() ) );
if ( nullNode != null ) join.setOptional( "true".equals( nullNode.getValue() ) );
  + join.getTable().getName() );
join.setKey( key );
key.setCascadeDeleteEnabled( "cascade".equals( keyNode.attributeValue( "on-delete" ) ) );
bindSimpleValue( keyNode, key, false, persistentClass.getEntityName(), mappings );
join.createPrimaryKey();
join.createForeignKey();
      subnode,
      (Component) value,
      join.getPersistentClass().getClassName(),
      propertyName,
      subpath,
origin: hibernate/hibernate-orm

  Join secondaryTableJoin,
  final EntityTableXref entityTableXref) {
final PersistentClass persistentClass = secondaryTableJoin.getPersistentClass();
secondaryTableJoin.setTable( secondaryTable );
entityTableXref.addSecondaryTable( mappingDocument, logicalTableName, secondaryTableJoin );
);
secondaryTableJoin.setSequentialSelect( secondaryTableSource.getFetchStyle() == FetchStyle.SELECT );
secondaryTableJoin.setInverse( secondaryTableSource.isInverse() );
secondaryTableJoin.setOptional( secondaryTableSource.isOptional() );
  keyBinding.makeNationalized();
secondaryTableJoin.setKey( keyBinding );
  secondaryTableJoin.createPrimaryKey();
  secondaryTableJoin.createForeignKey();
origin: hibernate/hibernate-orm

while ( it.hasNext() ) {
  Join otherSideJoinValue = (Join) it.next();
  if ( otherSideJoinValue.containsProperty( otherSideProperty ) ) {
    otherSideJoin = otherSideJoinValue;
    break;
      (PersistentClass) persistentClasses.get( ownerEntity ), otherSideProperty, otherSideJoin
  );
  ManyToOne manyToOne = new ManyToOne( buildingContext, mappedByJoin.getTable() );
  manyToOne.setUnwrapProxy( value.isUnwrapProxy() );
  prop.setValue( manyToOne );
  Iterator otherSideJoinKeyColumns = otherSideJoin.getKey().getColumnIterator();
  while ( otherSideJoinKeyColumns.hasNext() ) {
    Column column = (Column) otherSideJoinKeyColumns.next();
    manyToOne.addColumn( copy );
  mappedByJoin.addProperty( prop );
origin: org.hibernate.orm/hibernate-core

Join join = new Join();
join.setPersistentClass( persistentClass );
join.setTable( originalJoin.getMappedTable() );
join.setInverse( true );
SimpleValue key = new DependantValue(
    buildingContext,
    join.getMappedTable(),
    persistentClass.getIdentifier()
);
join.setKey( key );
join.setSequentialSelect( false );
join.setOptional( true ); //perhaps not quite per-spec, but a Good Thing anyway
key.setCascadeDeleteEnabled( false );
otherSideProperty.getValue()
    .forEach( column -> key.addColumn( ( (Column) column ).clone() ) );
persistentClass.addJoin( join );
join.createForeignKey();
return join;
origin: hibernate/hibernate-orm

private static void bindCustomSql(
    MappingDocument sourceDocument,
    SecondaryTableSource secondaryTableSource,
    Join secondaryTable) {
  if ( secondaryTableSource.getCustomSqlInsert() != null ) {
    secondaryTable.setCustomSQLInsert(
        secondaryTableSource.getCustomSqlInsert().getSql(),
        secondaryTableSource.getCustomSqlInsert().isCallable(),
        secondaryTableSource.getCustomSqlInsert().getCheckStyle()
    );
  }
  if ( secondaryTableSource.getCustomSqlUpdate() != null ) {
    secondaryTable.setCustomSQLUpdate(
        secondaryTableSource.getCustomSqlUpdate().getSql(),
        secondaryTableSource.getCustomSqlUpdate().isCallable(),
        secondaryTableSource.getCustomSqlUpdate().getCheckStyle()
    );
  }
  if ( secondaryTableSource.getCustomSqlDelete() != null ) {
    secondaryTable.setCustomSQLDelete(
        secondaryTableSource.getCustomSqlDelete().getSql(),
        secondaryTableSource.getCustomSqlDelete().isCallable(),
        secondaryTableSource.getCustomSqlDelete().getCheckStyle()
    );
  }
}
origin: hibernate/hibernate-orm

/**
 * Needed for proper compliance with naming strategy, the property table
 * can be overriden if the properties are part of secondary tables
 */
private Map<String, Join> getJoinsPerRealTableName() {
  if ( joinsPerRealTableName == null ) {
    joinsPerRealTableName = new HashMap<String, Join>( joins.size() );
    for (Join join : joins.values()) {
      joinsPerRealTableName.put( join.getTable().getName(), join );
    }
  }
  return joinsPerRealTableName;
}
origin: hibernate/hibernate-orm

final Join secondaryTableJoin = new Join();
secondaryTableJoin.setPersistentClass( entityDescriptor );
bindSecondaryTable(
    mappingDocument,
      table = secondaryTableJoin.getTable();
      attributeContainer = secondaryTableJoin;
      attribute.setOptional( secondaryTableJoin.isOptional() );
      table = secondaryTableJoin.getTable();
      attributeContainer = secondaryTableJoin;
      attribute.setOptional( secondaryTableJoin.isOptional() );
      table = secondaryTableJoin.getTable();
      attributeContainer = secondaryTableJoin;
      attribute.setOptional( secondaryTableJoin.isOptional() );
      table = secondaryTableJoin.getTable();
      attributeContainer = secondaryTableJoin;
      attribute.setOptional( secondaryTableJoin.isOptional() );
origin: jboss.jboss-embeddable-ejb3/hibernate-all

public static void bindJoinToPersistentClass(
    Join join, Ejb3JoinColumn[] ejb3JoinColumns, PersistentClass persistentClass, ExtendedMappings mappings
) {
  SimpleValue key = new DependantValue( join.getTable(), persistentClass.getIdentifier() );
  join.setKey( key );
  join.setSequentialSelect( false );
  join.setInverse( false );
  join.setOptional( true ); //perhaps not quite per-spec, but a Good Thing anyway
  key.setCascadeDeleteEnabled( false );
  TableBinder.bindFk( persistentClass, null, ejb3JoinColumns, key, false, mappings );
  join.createPrimaryKey();
  join.createForeignKey();
  persistentClass.addJoin( join );
}
origin: hibernate/hibernate-orm

public boolean isLazy() {
  Iterator iter = getPropertyIterator();
  while ( iter.hasNext() ) {
    Property prop = (Property) iter.next();
    if ( !prop.isLazy() ) {
      return false;
    }
  }
  return true;
}
origin: hibernate/hibernate-orm

public void createForeignKey() {
  getKey().createForeignKeyOfEntity( persistentClass.getEntityName() );
}
origin: hibernate/hibernate-orm

  referencedTable = ( (Join) columnOwner ).getTable();
Iterator it = isPersistentClass ?
    ( (PersistentClass) columnOwner ).getPropertyIterator() :
    ( (Join) columnOwner ).getPropertyIterator();
while ( it.hasNext() ) {
  matchColumnsByProperty( (Property) it.next(), columnsToProperty );
origin: jboss.jboss-embeddable-ejb3/hibernate-all

    boolean noDelayInPkColumnCreation
) {
  Join join = new Join();
  join.setPersistentClass( persistentClass );
  String schema;
  String catalog;
origin: hibernate/hibernate-orm

protected void checkColumnDuplication() {
  HashSet cols = new HashSet();
  if ( getIdentifierMapper() == null ) {
    //an identifier mapper => getKey will be included in the getNonDuplicatedPropertyIterator()
    //and checked later, so it needs to be excluded
    checkColumnDuplication( cols, getKey().getColumnIterator() );
  }
  checkColumnDuplication( cols, getDiscriminatorColumnIterator() );
  checkPropertyColumnDuplication( cols, getNonDuplicatedPropertyIterator() );
  Iterator iter = getJoinIterator();
  while ( iter.hasNext() ) {
    cols.clear();
    Join join = (Join) iter.next();
    checkColumnDuplication( cols, join.getKey().getColumnIterator() );
    checkPropertyColumnDuplication( cols, join.getPropertyIterator() );
  }
}
org.hibernate.mappingJoin

Most used methods

  • getTable
  • getKey
  • getPropertyIterator
  • <init>
  • addProperty
  • createForeignKey
  • createPrimaryKey
  • isOptional
  • setCustomSQLDelete
  • setCustomSQLInsert
  • setCustomSQLUpdate
  • setInverse
  • setCustomSQLUpdate,
  • setInverse,
  • setKey,
  • setOptional,
  • setPersistentClass,
  • setSequentialSelect,
  • setTable,
  • containsProperty,
  • getPersistentClass,
  • getPropertySpan

Popular in Java

  • Running tasks concurrently on multiple threads
  • getExternalFilesDir (Context)
  • setRequestProperty (URLConnection)
  • getSharedPreferences (Context)
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • Collectors (java.util.stream)
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Table (org.hibernate.mapping)
    A relational table
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • PhpStorm for WordPress
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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