org.hibernate.annotations.Table类的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(12.1k)|赞(0)|评价(0)|浏览(203)

本文整理了Java中org.hibernate.annotations.Table类的一些代码示例,展示了Table类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table类的具体详情如下:
包路径:org.hibernate.annotations.Table
类名称:Table

Table介绍

暂无

代码示例

代码示例来源:origin: hibernate/hibernate-orm

@Entity(name = "TableWithComment")
@javax.persistence.Table(name = "TABLE_WITH_COMMENT")
@Table(appliesTo = "TABLE_WITH_COMMENT", comment = "comment snippet")
public static class TableWithComment {
  @Id
  private int id;
}

代码示例来源:origin: hibernate/hibernate-orm

public void processComplementaryTableDefinitions(org.hibernate.annotations.Table table) {
  String appliedTable = table.appliesTo();
  Iterator tables = persistentClass.getTableClosureIterator();
  Table hibTable = null;
    );
  if ( !BinderHelper.isEmptyAnnotationValue( table.comment() ) ) hibTable.setComment( table.comment() );
  TableBinder.addIndexes( hibTable, table.indexes(), context );

代码示例来源:origin: hibernate/hibernate-orm

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(
            matchingTable.sqlInsert().check().toString().toLowerCase(Locale.ROOT)
  if ( !BinderHelper.isEmptyAnnotationValue( matchingTable.sqlUpdate().sql() ) ) {
    join.setCustomSQLUpdate( matchingTable.sqlUpdate().sql().trim(),
        matchingTable.sqlUpdate().callable(),
        ExecuteUpdateResultCheckStyle.fromExternalName(
            matchingTable.sqlUpdate().check().toString().toLowerCase(Locale.ROOT)
  if ( !BinderHelper.isEmptyAnnotationValue( matchingTable.sqlDelete().sql() ) ) {
    join.setCustomSQLDelete( matchingTable.sqlDelete().sql().trim(),
        matchingTable.sqlDelete().callable(),
        ExecuteUpdateResultCheckStyle.fromExternalName(
            matchingTable.sqlDelete().check().toString().toLowerCase(Locale.ROOT)

代码示例来源:origin: jboss.jboss-embeddable-ejb3/hibernate-all

String tableName = table.appliesTo();
Iterator tables = persistentClass.getTableClosureIterator();
Table hibTable = null;
  );
TableBinder.addIndexes( hibTable, table.indexes(), mappings );

代码示例来源:origin: hibernate/hibernate-orm

private org.hibernate.annotations.Table findMatchingComplimentTableAnnotation(Join join) {
  String tableName = join.getTable().getQuotedName();
  org.hibernate.annotations.Table table = annotatedClass.getAnnotation( org.hibernate.annotations.Table.class );
  org.hibernate.annotations.Table matchingTable = null;
  if ( table != null && tableName.equals( table.appliesTo() ) ) {
    matchingTable = table;
  }
  else {
    Tables tables = annotatedClass.getAnnotation( Tables.class );
    if ( tables != null ) {
      for (org.hibernate.annotations.Table current : tables.value()) {
        if ( tableName.equals( current.appliesTo() ) ) {
          matchingTable = current;
          break;
        }
      }
    }
  }
  return matchingTable;
}

代码示例来源:origin: hibernate/hibernate-orm

private void setFKNameIfDefined(Join join) {
  // just awful..
  org.hibernate.annotations.Table matchingTable = findMatchingComplimentTableAnnotation( join );
  if ( matchingTable != null && !BinderHelper.isEmptyAnnotationValue( matchingTable.foreignKey().name() ) ) {
    ( (SimpleValue) join.getKey() ).setForeignKeyName( matchingTable.foreignKey().name() );
  }
  else {
    javax.persistence.SecondaryTable jpaSecondaryTable = findMatchingSecondaryTable( join );
    if ( jpaSecondaryTable != null ) {
      if ( jpaSecondaryTable.foreignKey().value() == ConstraintMode.NO_CONSTRAINT ) {
        ( (SimpleValue) join.getKey() ).setForeignKeyName( "none" );
      }
      else {
        ( (SimpleValue) join.getKey() ).setForeignKeyName( StringHelper.nullIfEmpty( jpaSecondaryTable.foreignKey().name() ) );
        ( (SimpleValue) join.getKey() ).setForeignKeyDefinition( StringHelper.nullIfEmpty( jpaSecondaryTable.foreignKey().foreignKeyDefinition() ) );
      }
    }
  }
}

代码示例来源:origin: org.hibernate/hibernate-annotations

private org.hibernate.annotations.Table findMatchingComplimentTableAnnotation(Join join) {
  String tableName = join.getTable().getQuotedName();
  org.hibernate.annotations.Table table = annotatedClass.getAnnotation( org.hibernate.annotations.Table.class );
  org.hibernate.annotations.Table matchingTable = null;
  if ( table != null && tableName.equals( table.appliesTo() ) ) {
    matchingTable = table;
  }
  else {
    Tables tables = annotatedClass.getAnnotation( Tables.class );
    if ( tables != null ) {
      for (org.hibernate.annotations.Table current : tables.value()) {
        if ( tableName.equals( current.appliesTo() ) ) {
          matchingTable = current;
          break;
        }
      }
    }
  }
  return matchingTable;
}

代码示例来源:origin: org.hibernate/hibernate-annotations

private void setFKNameIfDefined(Join join) {
  org.hibernate.annotations.Table matchingTable = findMatchingComplimentTableAnnotation( join );
  if ( matchingTable != null && !BinderHelper.isDefault( matchingTable.foreignKey().name() ) ) {
    ( (SimpleValue) join.getKey() ).setForeignKeyName( matchingTable.foreignKey().name() );
  }
}

代码示例来源:origin: BroadleafCommerce/BroadleafCommerce

@AdminPresentationClass(populateToOneFields = PopulateToOneFieldsEnum.TRUE, friendlyName = "TranslationImpl_baseTranslation")
@Table(appliesTo = "BLC_TRANSLATION", indexes = {
    @Index(name = "TRANSLATION_INDEX", columnNames = { "ENTITY_TYPE", "ENTITY_ID", "FIELD_NAME", "LOCALE_CODE" })
})

代码示例来源:origin: org.hibernate/hibernate-annotations

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.isDefault( matchingTable.sqlInsert().sql() ) ) {
    join.setCustomSQLInsert( matchingTable.sqlInsert().sql().trim(),
        matchingTable.sqlInsert().callable(),
        ExecuteUpdateResultCheckStyle.parse( matchingTable.sqlInsert().check().toString().toLowerCase() )
    );
  if ( !BinderHelper.isDefault( matchingTable.sqlUpdate().sql() ) ) {
    join.setCustomSQLUpdate( matchingTable.sqlUpdate().sql().trim(),
        matchingTable.sqlUpdate().callable(),
        ExecuteUpdateResultCheckStyle.parse( matchingTable.sqlUpdate().check().toString().toLowerCase() )
    );
  if ( !BinderHelper.isDefault( matchingTable.sqlDelete().sql() ) ) {
    join.setCustomSQLDelete( matchingTable.sqlDelete().sql().trim(),
        matchingTable.sqlDelete().callable(),
        ExecuteUpdateResultCheckStyle.parse( matchingTable.sqlDelete().check().toString().toLowerCase() )
    );

代码示例来源:origin: org.hibernate/hibernate-annotations

public void processComplementaryTableDefinitions(org.hibernate.annotations.Table table) {
  String appliedTable = table.appliesTo();
  Iterator tables = persistentClass.getTableClosureIterator();
  Table hibTable = null;
    );
  if ( !BinderHelper.isDefault( table.comment() ) ) hibTable.setComment( table.comment() );
  TableBinder.addIndexes( hibTable, table.indexes(), mappings );

代码示例来源:origin: org.hibernate.orm/hibernate-core

private org.hibernate.annotations.Table findMatchingComplimentTableAnnotation(Join join) {
  String tableName = join.getTable().getQuotedName();
  org.hibernate.annotations.Table table = annotatedClass.getAnnotation( org.hibernate.annotations.Table.class );
  org.hibernate.annotations.Table matchingTable = null;
  if ( table != null && tableName.equals( table.appliesTo() ) ) {
    matchingTable = table;
  }
  else {
    Tables tables = annotatedClass.getAnnotation( Tables.class );
    if ( tables != null ) {
      for (org.hibernate.annotations.Table current : tables.value()) {
        if ( tableName.equals( current.appliesTo() ) ) {
          matchingTable = current;
          break;
        }
      }
    }
  }
  return matchingTable;
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core

private void setFKNameIfDefined(Join join) {
  org.hibernate.annotations.Table matchingTable = findMatchingComplimentTableAnnotation( join );
  if ( matchingTable != null && !BinderHelper.isEmptyAnnotationValue( matchingTable.foreignKey().name() ) ) {
    ( (SimpleValue) join.getKey() ).setForeignKeyName( matchingTable.foreignKey().name() );
  }
}

代码示例来源:origin: hibernate/hibernate-orm

@SecondaryTable(name = "Cat2", uniqueConstraints = {@UniqueConstraint(columnNames = {"storyPart2"})})
    })
@Table(appliesTo = "Cat", indexes = @Index(name = "secondname",
    columnNames = "secondName"), comment = "My cat table" )
@Table(appliesTo = "Cat2", foreignKey = @ForeignKey(name="FK_CAT2_CAT"), fetch = FetchMode.SELECT,
    sqlInsert=@SQLInsert(sql="insert into Cat2(storyPart2, id) values(upper(?), ?)") )
public class Cat implements Serializable {

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate

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(
            matchingTable.sqlInsert().check().toString().toLowerCase()
  if ( !BinderHelper.isEmptyAnnotationValue( matchingTable.sqlUpdate().sql() ) ) {
    join.setCustomSQLUpdate( matchingTable.sqlUpdate().sql().trim(),
        matchingTable.sqlUpdate().callable(),
        ExecuteUpdateResultCheckStyle.fromExternalName(
            matchingTable.sqlUpdate().check().toString().toLowerCase()
  if ( !BinderHelper.isEmptyAnnotationValue( matchingTable.sqlDelete().sql() ) ) {
    join.setCustomSQLDelete( matchingTable.sqlDelete().sql().trim(),
        matchingTable.sqlDelete().callable(),
        ExecuteUpdateResultCheckStyle.fromExternalName(
            matchingTable.sqlDelete().check().toString().toLowerCase()

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core

public void processComplementaryTableDefinitions(org.hibernate.annotations.Table table) {
  String appliedTable = table.appliesTo();
  Iterator tables = persistentClass.getTableClosureIterator();
  Table hibTable = null;
    );
  if ( !BinderHelper.isEmptyAnnotationValue( table.comment() ) ) hibTable.setComment( table.comment() );
  TableBinder.addIndexes( hibTable, table.indexes(), mappings );

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core

private org.hibernate.annotations.Table findMatchingComplimentTableAnnotation(Join join) {
  String tableName = join.getTable().getQuotedName();
  org.hibernate.annotations.Table table = annotatedClass.getAnnotation( org.hibernate.annotations.Table.class );
  org.hibernate.annotations.Table matchingTable = null;
  if ( table != null && tableName.equals( table.appliesTo() ) ) {
    matchingTable = table;
  }
  else {
    Tables tables = annotatedClass.getAnnotation( Tables.class );
    if ( tables != null ) {
      for (org.hibernate.annotations.Table current : tables.value()) {
        if ( tableName.equals( current.appliesTo() ) ) {
          matchingTable = current;
          break;
        }
      }
    }
  }
  return matchingTable;
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate

private void setFKNameIfDefined(Join join) {
  org.hibernate.annotations.Table matchingTable = findMatchingComplimentTableAnnotation( join );
  if ( matchingTable != null && !BinderHelper.isEmptyAnnotationValue( matchingTable.foreignKey().name() ) ) {
    ( (SimpleValue) join.getKey() ).setForeignKeyName( matchingTable.foreignKey().name() );
  }
}

代码示例来源:origin: hibernate/hibernate-orm

@org.hibernate.annotations.Table(
  appliesTo = "person_details",
  sqlInsert = @SQLInsert(

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core

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(
            matchingTable.sqlInsert().check().toString().toLowerCase()
  if ( !BinderHelper.isEmptyAnnotationValue( matchingTable.sqlUpdate().sql() ) ) {
    join.setCustomSQLUpdate( matchingTable.sqlUpdate().sql().trim(),
        matchingTable.sqlUpdate().callable(),
        ExecuteUpdateResultCheckStyle.fromExternalName(
            matchingTable.sqlUpdate().check().toString().toLowerCase()
  if ( !BinderHelper.isEmptyAnnotationValue( matchingTable.sqlDelete().sql() ) ) {
    join.setCustomSQLDelete( matchingTable.sqlDelete().sql().trim(),
        matchingTable.sqlDelete().callable(),
        ExecuteUpdateResultCheckStyle.fromExternalName(
            matchingTable.sqlDelete().check().toString().toLowerCase()

相关文章