本文整理了Java中javax.persistence.JoinTable.inverseJoinColumns()
方法的一些代码示例,展示了JoinTable.inverseJoinColumns()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JoinTable.inverseJoinColumns()
方法的具体详情如下:
包路径:javax.persistence.JoinTable
类名称:JoinTable
方法名:inverseJoinColumns
暂无
代码示例来源:origin: requery/requery
JoinTableAssociation(JoinTable table) {
this.table = table;
this.columns = new LinkedHashSet<>();
for (JoinColumn column : table.joinColumns()) {
String columnName = column.name();
ForeignKey foreignKey = column.foreignKey();
ReferentialAction action = mapConstraint(foreignKey.value());
columns.add(new AssociativeReference(columnName, null, null, action, action));
}
for (JoinColumn column : table.inverseJoinColumns()) {
String columnName = column.name();
ForeignKey foreignKey = column.foreignKey();
ReferentialAction action = mapConstraint(foreignKey.value());
columns.add(new AssociativeReference(columnName, null, null, action, action));
}
}
代码示例来源:origin: hibernate/hibernate-orm
if ( joinTableAnn != null ) {
joinColumns = Ejb3JoinColumn.buildJoinColumns(
joinTableAnn.inverseJoinColumns(),
null,
entityBinder.getSecondaryTables(),
代码示例来源: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: 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
ad.setValue( "uniqueConstraints", table.uniqueConstraints() );
ad.setValue( "joinColumns", table.joinColumns() );
ad.setValue( "inverseJoinColumns", table.inverseJoinColumns() );
代码示例来源:origin: hibernate/hibernate-orm
uniqueConstraints = assocTable.uniqueConstraints();
joins = assocTable.joinColumns();
inverseJoins = assocTable.inverseJoinColumns();
jpaIndexes = assocTable.indexes();
代码示例来源:origin: hibernate/hibernate-orm
if ( joinTableAnn != null && joinTableAnn.inverseJoinColumns().length > 0 ) {
String path = collValue.getOwnerEntityName() + "." + joinColumns[0].getPropertyName();
throw new AnnotationException(
String foreignKeyDefinition = joinTableAnn.inverseForeignKey().foreignKeyDefinition();
ConstraintMode foreignKeyValue = joinTableAnn.inverseForeignKey().value();
if ( joinTableAnn.inverseJoinColumns().length != 0 ) {
final JoinColumn joinColumnAnn = joinTableAnn.inverseJoinColumns()[0];
if ( "".equals( foreignKeyName ) ) {
foreignKeyName = joinColumnAnn.foreignKey().name();
代码示例来源: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: ebean-orm/ebean
/**
* Define the joins for a ManyToMany relationship.
* <p>
* This includes joins to the intersection table and from the intersection table
* to the other side of the ManyToMany.
* </p>
*/
private void readJoinTable(JoinTable joinTable, DeployBeanPropertyAssocMany<?> prop) {
String intTableName = getFullTableName(joinTable);
if (intTableName.isEmpty()) {
BeanTable localTable = factory.getBeanTable(descriptor.getBeanType());
BeanTable otherTable = factory.getBeanTable(prop.getTargetType());
intTableName = getM2MJoinTableName(localTable, otherTable);
}
// set the intersection table
DeployTableJoin intJoin = new DeployTableJoin();
intJoin.setTable(intTableName);
// add the source to intersection join columns
intJoin.addJoinColumn(true, joinTable.joinColumns(), prop.getBeanTable());
// set the intersection to dest table join columns
DeployTableJoin destJoin = prop.getTableJoin();
destJoin.addJoinColumn(false, joinTable.inverseJoinColumns(), prop.getBeanTable());
intJoin.setType(SqlJoinType.OUTER);
// reverse join from dest back to intersection
DeployTableJoin inverseDest = destJoin.createInverse(intTableName);
prop.setIntersectionJoin(intJoin);
prop.setInverseJoin(inverseDest);
}
代码示例来源: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
JoinColumn[] inverseJoinColumns = joinTableAnno.inverseJoinColumns();
assertEquals( 2, inverseJoinColumns.length );
assertEquals( "", inverseJoinColumns[0].name() );
代码示例来源:origin: hibernate/hibernate-orm
JoinColumn[] inverseJoinColumns = joinTableAnno.inverseJoinColumns();
assertEquals( 2, inverseJoinColumns.length );
assertEquals( "", inverseJoinColumns[0].name() );
代码示例来源:origin: org.hibernate/hibernate-annotations
if ( joinTableAnn != null && joinTableAnn.inverseJoinColumns().length > 0 ) {
String path = collValue.getOwnerEntityName() + "." + joinColumns[0].getPropertyName();
throw new AnnotationException(
代码示例来源:origin: hibernate/hibernate-orm
JoinColumn[] inverseJoinColumns = joinTableAnno.inverseJoinColumns();
assertEquals( 2, inverseJoinColumns.length );
assertEquals( "", inverseJoinColumns[0].name() );
代码示例来源:origin: org.hibernate/hibernate-annotations
ad.setValue( "uniqueConstraints", table.uniqueConstraints() );
ad.setValue( "joinColumns", table.joinColumns() );
ad.setValue( "inverseJoinColumns", table.inverseJoinColumns() );
代码示例来源:origin: org.hibernate/hibernate-annotations
uniqueConstraints = assocTable.uniqueConstraints();
joins = assocTable.joinColumns();
inverseJoins = assocTable.inverseJoinColumns();
代码示例来源: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-persistence-jdbc
/**
* 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());
}
代码示例来源:origin: org.apache.openejb.patch/openjpa
/**
* 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());
}
代码示例来源: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());
}
内容来源于网络,如有侵权,请联系作者删除!