No effective change - code cleanup - BeanPropertyAssoc cleanup

This commit is contained in:
Robin Bygrave
2015-07-31 21:41:28 +12:00
parent c0fc7d69a6
commit 84b8777c2b
3 changed files with 10 additions and 41 deletions
@@ -73,7 +73,7 @@ public abstract class BeanPropertyAssoc<T> extends BeanProperty {
/**
* Construct the property.
*/
public BeanPropertyAssoc(BeanDescriptorMap owner, BeanDescriptor<?> descriptor, DeployBeanPropertyAssoc<T> deploy) {
public BeanPropertyAssoc(BeanDescriptor<?> descriptor, DeployBeanPropertyAssoc<T> deploy) {
super(descriptor, deploy);
this.extraWhere = InternString.intern(deploy.getExtraWhere());
this.isOuterJoin = deploy.isOuterJoin();
@@ -172,18 +172,9 @@ public abstract class BeanPropertyAssoc<T> extends BeanProperty {
}
public boolean isSaveRecurseSkippable(Object bean) {
if (!saveRecurseSkippable){
// we have to saveRecurse even if the bean is not dirty
// as this bean has cascade save on some of its properties
return false;
}
if (bean instanceof EntityBean){
return !((EntityBean)bean)._ebean_getIntercept().isNewOrDirty();
} else {
// we don't know so we say no
return false;
}
}
return saveRecurseSkippable && bean instanceof EntityBean && !((EntityBean) bean)._ebean_getIntercept().isNewOrDirty();
}
/**
* Return true if save can be skipped for unmodified bean(s) of this
@@ -198,13 +189,6 @@ public abstract class BeanPropertyAssoc<T> extends BeanProperty {
return saveRecurseSkippable;
}
/**
* Similar to isSaveRecurseSkippable but in terms of delete.
*/
public boolean isDeleteRecurseSkippable() {
return deleteRecurseSkippable;
}
/**
* Return true if the unique id properties are all not null for this bean.
*/
@@ -241,34 +225,19 @@ public abstract class BeanPropertyAssoc<T> extends BeanProperty {
return extraWhere;
}
/**
* Return if this association should use an Outer join.
*/
public boolean isOuterJoin() {
return isOuterJoin;
}
/**
* Return true if this association is updateable.
*/
public boolean isUpdateable() {
if (tableJoin.columns().length > 0) {
return tableJoin.columns()[0].isUpdateable();
}
return true;
}
return tableJoin.columns().length <= 0 || tableJoin.columns()[0].isUpdateable();
}
/**
* Return true if this association is insertable.
*/
public boolean isInsertable() {
if (tableJoin.columns().length > 0) {
return tableJoin.columns()[0].isInsertable();
}
return true;
}
return tableJoin.columns().length <= 0 || tableJoin.columns()[0].isInsertable();
}
/**
* return the join to use for the bean.
@@ -102,7 +102,7 @@ public class BeanPropertyAssocMany<T> extends BeanPropertyAssoc<T> {
* Create this property.
*/
public BeanPropertyAssocMany(BeanDescriptorMap owner, BeanDescriptor<?> descriptor, DeployBeanPropertyAssocMany<T> deploy) {
super(owner, descriptor, deploy);
super(descriptor, deploy);
this.unidirectional = deploy.isUnidirectional();
this.manyToMany = deploy.isManyToMany();
this.manyType = deploy.getManyType();
@@ -68,7 +68,7 @@ public class BeanPropertyAssocOne<T> extends BeanPropertyAssoc<T> {
public BeanPropertyAssocOne(BeanDescriptorMap owner, BeanDescriptor<?> descriptor,
DeployBeanPropertyAssocOne<T> deploy) {
super(owner, descriptor, deploy);
super(descriptor, deploy);
importedPrimaryKey = deploy.isImportedPrimaryKey();
oneToOne = deploy.isOneToOne();