javax.persistence.JoinTable.name()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(7.6k)|赞(0)|评价(0)|浏览(117)

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

JoinTable.name介绍

暂无

代码示例

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

@Override
public String name() {
  return table.name();
}

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

buildingContext
);
if ( StringHelper.isEmpty( joinTableAnn.name() ) ) {
  throw new AnnotationException(
      "JoinTable.name() on a @ToOne association has to be explicit: "

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

/**
 * When there's a single association override, we still wrap it with an
 * AssociationOverrides annotation.
 */
@Test
public void testSingleAssociationOverride() throws Exception {
  reader = getReader( Entity3.class, "field1", "element-collection.orm24.xml" );
  assertAnnotationPresent( ElementCollection.class );
  assertAnnotationNotPresent( AssociationOverride.class );
  assertAnnotationPresent( AssociationOverrides.class );
  AssociationOverrides overridesAnno = reader.getAnnotation( AssociationOverrides.class );
  AssociationOverride[] overrides = overridesAnno.value();
  assertEquals( 1, overrides.length );
  assertEquals( "association1", overrides[0].name() );
  assertEquals( 0, overrides[0].joinColumns().length );
  assertEquals( "", overrides[0].joinTable().name() );
}

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

@Test
public void testJoinTableNoChildren() throws Exception {
  reader = getReader( Entity2.class, "field1", "many-to-many.orm16.xml" );
  assertAnnotationPresent( ManyToMany.class );
  assertAnnotationPresent( JoinTable.class );
  assertAnnotationNotPresent( JoinColumns.class );
  assertAnnotationNotPresent( JoinColumn.class );
  JoinTable joinTableAnno = reader.getAnnotation( JoinTable.class );
  assertEquals( "", joinTableAnno.catalog() );
  assertEquals( "", joinTableAnno.name() );
  assertEquals( "", joinTableAnno.schema() );
  assertEquals( 0, joinTableAnno.joinColumns().length );
  assertEquals( 0, joinTableAnno.inverseJoinColumns().length );
  assertEquals( 0, joinTableAnno.uniqueConstraints().length );
}

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

/**
 * Return the full table name
 */
private String getFullTableName(JoinTable joinTable) {
 StringBuilder sb = new StringBuilder();
 if (!StringHelper.isNull(joinTable.catalog())) {
  sb.append(joinTable.catalog()).append(".");
 }
 if (!StringHelper.isNull(joinTable.schema())) {
  sb.append(joinTable.schema()).append(".");
 }
 sb.append(joinTable.name());
 return sb.toString();
}

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

.getJdbcEnvironment()
      .getIdentifierHelper()
      .toIdentifier( joinTable.name() )
);
joinColumns = joinTable.joinColumns();

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

@Test
public void testJoinTableNoChildren() throws Exception {
  reader = getReader( Entity1.class, "field1", "many-to-one.orm4.xml" );
  assertAnnotationPresent( ManyToOne.class );
  assertAnnotationNotPresent( JoinColumn.class );
  assertAnnotationNotPresent( JoinColumns.class );
  assertAnnotationPresent( JoinTable.class );
  JoinTable joinTableAnno = reader.getAnnotation( JoinTable.class );
  assertEquals( "", joinTableAnno.catalog() );
  assertEquals( "", joinTableAnno.name() );
  assertEquals( "", joinTableAnno.schema() );
  assertEquals( 0, joinTableAnno.joinColumns().length );
  assertEquals( 0, joinTableAnno.inverseJoinColumns().length );
  assertEquals( 0, joinTableAnno.uniqueConstraints().length );
}

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

JoinTable table = getPhysicalAnnotation( annotationType );
if ( table != null ) {
  ad.setValue( "name", table.name() );
  ad.setValue( "schema", table.schema() );
  ad.setValue( "catalog", table.catalog() );

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

catalog = assocTable.catalog();
schema = assocTable.schema();
tableName = assocTable.name();
uniqueConstraints = assocTable.uniqueConstraints();
joins = assocTable.joinColumns();

代码示例来源:origin: Impetus/Kundera

/**
 * Instantiates a new join table metadata.
 * 
 * @param relationField
 *            the relation field
 */
public JoinTableMetadata(Field relationField)
{
  JoinTable jtAnn = relationField.getAnnotation(JoinTable.class);
  setJoinTableName(jtAnn.name());
  setJoinTableSchema(jtAnn.schema());
  for (JoinColumn joinColumn : jtAnn.joinColumns())
  {
    addJoinColumns(joinColumn.name());
  }
  for (JoinColumn inverseJoinColumn : jtAnn.inverseJoinColumns())
  {
    addInverseJoinColumns(inverseJoinColumn.name());
  }
}

代码示例来源:origin: SAP/olingo-jpa-processor-v4

/**
 * Returns the name of database table
 * @return
 */
@Override
public String getTableName() {
 return jpaJoinTable.name();
}

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

Ejb3JoinColumn[] buildDefaultJoinColumnsForXToOne(XProperty property, PropertyData inferredData) {
  Ejb3JoinColumn[] joinColumns;
  JoinTable joinTableAnn = propertyHolder.getJoinTable( property );
  if ( joinTableAnn != null ) {
    joinColumns = Ejb3JoinColumn.buildJoinColumns(
        joinTableAnn.inverseJoinColumns(), null, entityBinder.getSecondaryTables(),
        propertyHolder, inferredData.getPropertyName(), mappings
    );
    if ( StringHelper.isEmpty( joinTableAnn.name() ) ) {
      throw new AnnotationException(
          "JoinTable.name() on a @ToOne association has to be explicit: "
              + BinderHelper.getPath( propertyHolder, inferredData )
      );
    }
  }
  else {
    OneToOne oneToOneAnn = property.getAnnotation( OneToOne.class );
    String mappedBy = oneToOneAnn != null ?
        oneToOneAnn.mappedBy() :
        null;
    joinColumns = Ejb3JoinColumn.buildJoinColumns(
        null,
        mappedBy, entityBinder.getSecondaryTables(),
        propertyHolder, inferredData.getPropertyName(), mappings
    );
  }
  return joinColumns;
}

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

JoinTable joinTableAnno = reader.getAnnotation( JoinTable.class );
assertEquals( "cat1", joinTableAnno.catalog() );
assertEquals( "table1", joinTableAnno.name() );
assertEquals( "schema1", joinTableAnno.schema() );

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

schema = joinTable.schema();
catalog = joinTable.catalog();
secondaryTableNameContext = new SecondaryTableNameSource( joinTable.name() );
joinColumns = joinTable.joinColumns();
uniqueConstraintHolders = TableBinder.buildUniqueConstraintHolders( joinTable.uniqueConstraints() );

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

JoinTable joinTableAnno = reader.getAnnotation( JoinTable.class );
assertEquals( "cat1", joinTableAnno.catalog() );
assertEquals( "table1", joinTableAnno.name() );
assertEquals( "schema1", joinTableAnno.schema() );

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

assertEquals( "table1", joinTableAnno.name() );
assertEquals( "schema1", joinTableAnno.schema() );

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

JoinTable table = getJavaAnnotation( annotationType );
if ( table != null ) {
  ad.setValue( "name", table.name() );
  ad.setValue( "schema", table.schema() );
  ad.setValue( "catalog", table.catalog() );

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

catalog = assocTable.catalog();
schema = assocTable.schema();
tableName = assocTable.name();
uniqueConstraints = assocTable.uniqueConstraints();
joins = assocTable.joinColumns();

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

/**
 * Parse @JoinTable.
 */
private void parseJoinTable(FieldMapping fm, JoinTable join) {
  fm.getMappingInfo().setTableName(toTableName(join.schema(),
    join.name()));
  parseJoinColumns(fm, fm.getMappingInfo(), false, join.joinColumns());
  parseJoinColumns(fm, fm.getElementMapping().getValueInfo(), false,
    join.inverseJoinColumns());
}

代码示例来源:origin: org.apache.openjpa/openjpa-all

/**
 * Parse @JoinTable.
 */
private void parseJoinTable(FieldMapping fm, JoinTable join) {
  FieldMappingInfo info = fm.getMappingInfo();
  DBIdentifier joinTbl = toTableIdentifier(join.schema(), join.name());
  info.setTableIdentifier(joinTbl);
  parseJoinColumns(fm, info, false, join.joinColumns());
  parseJoinColumns(fm, fm.getElementMapping().getValueInfo(), false,
    join.inverseJoinColumns());
  addUniqueConstraints(info.getTableIdentifier().getName(), fm, info,  
    join.uniqueConstraints());
}

相关文章