mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-18 22:59:25 +00:00
Fixes for #94 - Additional API - added update(Collection beans); and insert(Collection beans); and #93 - ebean.properties defaultDeleteMissingChildren moved to updatesDeleteMissingChildren
This commit is contained in:
1 parent
e1ec0bcdfe
commit
1a13fc9742
19 files changed
+627
-344
No files matched your search
@@ -207,8 +207,9 @@ public class BeanDescriptor<T> implements MetaBeanInfo {
|
||||
* Derived list of properties that are used for version concurrency checking.
|
||||
*/
|
||||
private final BeanProperty versionProperty;
|
||||
|
||||
private final int versionPropertyIndex;
|
||||
|
||||
|
||||
/**
|
||||
* Properties local to this type (not from a super type).
|
||||
*/
|
||||
@@ -436,7 +437,7 @@ public class BeanDescriptor<T> implements MetaBeanInfo {
|
||||
this.versionPropertyIndex = (versionProperty == null) ? -1 : ebi.findProperty(versionProperty.getName());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create an entity bean that is used as a prototype/factory to create new instances.
|
||||
*/
|
||||
@@ -1818,6 +1819,12 @@ public class BeanDescriptor<T> implements MetaBeanInfo {
|
||||
}
|
||||
|
||||
public boolean isInsertMode(EntityBeanIntercept ebi) {
|
||||
|
||||
if (ebi.isLoaded()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// determine based on Id property
|
||||
if (idProperty.isEmbedded()) {
|
||||
return !ebi.isLoaded();
|
||||
}
|
||||
|
||||
@@ -107,6 +107,13 @@ public class BeanPropertyAssocOne<T> extends BeanPropertyAssoc<T> {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the property value as an entity bean.
|
||||
*/
|
||||
public EntityBean getValueAsEntityBean(EntityBean owner) {
|
||||
return (EntityBean)getValue(owner);
|
||||
}
|
||||
|
||||
public void setRelationshipProperty(BeanPropertyAssocMany<?> relationshipProperty){
|
||||
this.relationshipProperty = relationshipProperty;
|
||||
|
||||
Reference in new issue
Block a user