initial rework for new enhancement

This commit is contained in:
Robin Bygrave
2013-06-19 20:36:24 +12:00
parent eb1eafe98c
commit 4ec62a5772
193 changed files with 2737 additions and 5285 deletions
@@ -5,6 +5,7 @@ import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import com.avaje.ebeaninternal.server.deploy.BeanDescriptor;
import com.avaje.ebeaninternal.server.deploy.BeanProperty;
import com.avaje.ebeaninternal.server.deploy.TableJoin;
@@ -13,10 +14,14 @@ import com.avaje.ebeaninternal.server.deploy.TableJoin;
*/
public class SqlTreeProperties {
/**
* The included Properties that will be used by EntityBeanIntercept
* to determine lazy loading on partial objects.
*/
private static final TableJoin[] EMPTY_TABLE_JOINS = new TableJoin[0];
private final BeanDescriptor<?> desc;
// /**
// * The included Properties that will be used by EntityBeanIntercept
// * to determine lazy loading on partial objects.
// */
Set<String> includedProps;
/**
@@ -29,7 +34,7 @@ public class SqlTreeProperties {
*/
boolean includeId = true;
TableJoin[] tableJoins = new TableJoin[0];
TableJoin[] tableJoins = EMPTY_TABLE_JOINS;
/**
* The bean properties in order.
@@ -40,9 +45,11 @@ public class SqlTreeProperties {
* Maintain a list of property names to detect embedded bean additions.
*/
LinkedHashSet<String> propNames = new LinkedHashSet<String>();
public SqlTreeProperties() {
private boolean allProperties;
public SqlTreeProperties(BeanDescriptor<?> desc) {
this.desc = desc;
}
public boolean containsProperty(String propName){
@@ -56,9 +63,8 @@ public class SqlTreeProperties {
}
public void add(BeanProperty prop) {
propsList.add(prop);
propNames.add(prop.getName());
propsList.add(prop);
propNames.add(prop.getName());
}
public BeanProperty[] getProps() {
@@ -74,15 +80,7 @@ public class SqlTreeProperties {
}
public boolean isPartialObject() {
return includedProps != null;
}
public Set<String> getIncludedProperties() {
return includedProps;
}
public void setIncludedProperties(Set<String> includedProps) {
this.includedProps = includedProps;
return !allProperties;
}
public boolean isReadOnly() {
@@ -101,4 +99,12 @@ public class SqlTreeProperties {
this.tableJoins = tableJoins;
}
public void setAllProperties(boolean allProperties) {
this.allProperties = allProperties;
}
public boolean isAllProperties() {
return allProperties;
}
}