mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#1743 - Add hasForeignKeyConstraint()
Separate hasForeignKeyConstraint() for DDL use from hasForeignKey() used in query
This commit is contained in:
@@ -155,6 +155,20 @@ public abstract class BeanPropertyAssoc<T> extends BeanProperty implements STree
|
||||
return foreignKey;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if foreign key constraint is enabled on this relationship (not disabled).
|
||||
*/
|
||||
public boolean hasForeignKeyConstraint() {
|
||||
return foreignKey == null || !foreignKey.isNoConstraint();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if foreign key index is enabled on this relationship (not disabled).
|
||||
*/
|
||||
public boolean hasForeignKeyIndex() {
|
||||
return foreignKey == null || !foreignKey.isNoIndex();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a ElPropertyValue for a *ToOne or *ToMany.
|
||||
*/
|
||||
@@ -228,7 +242,7 @@ public abstract class BeanPropertyAssoc<T> extends BeanProperty implements STree
|
||||
|
||||
/**
|
||||
* Create a new query for the target type.
|
||||
*
|
||||
* <p>
|
||||
* We use target descriptor rather than target property type to support ElementCollection.
|
||||
*/
|
||||
public SpiQuery<T> newQuery(SpiEbeanServer server) {
|
||||
|
||||
@@ -363,10 +363,6 @@ public class BeanPropertyAssocOne<T> extends BeanPropertyAssoc<T> implements STr
|
||||
return foreignKey == null || primaryKeyJoin || !foreignKey.isNoConstraint();
|
||||
}
|
||||
|
||||
public boolean hasForeignKeyIndex() {
|
||||
return foreignKey == null || !foreignKey.isNoIndex();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if this a OneToOne property. Otherwise assumed ManyToOne.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user