mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
initial rework for new enhancement
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user