new feature: maxSize to specify maxamal size of a collection.
This commit is contained in:
parent
1912cdc6ea
commit
9f3fae9b2f
1 changed files with 27 additions and 18 deletions
|
@ -30,9 +30,9 @@ public class Relation {
|
||||||
// public final static int DIRECT = 3;
|
// public final static int DIRECT = 3;
|
||||||
|
|
||||||
// the DbMapping of the type we come from
|
// the DbMapping of the type we come from
|
||||||
public DbMapping ownType;
|
DbMapping ownType;
|
||||||
// the DbMapping of the prototype we link to, unless this is a "primitive" (non-object) relation
|
// the DbMapping of the prototype we link to, unless this is a "primitive" (non-object) relation
|
||||||
public DbMapping otherType;
|
DbMapping otherType;
|
||||||
|
|
||||||
// if this relation defines a virtual node, we need to provide a DbMapping for these virtual nodes
|
// if this relation defines a virtual node, we need to provide a DbMapping for these virtual nodes
|
||||||
DbMapping virtualMapping;
|
DbMapping virtualMapping;
|
||||||
|
@ -40,25 +40,26 @@ public class Relation {
|
||||||
Relation virtualRelation;
|
Relation virtualRelation;
|
||||||
Relation groupRelation;
|
Relation groupRelation;
|
||||||
|
|
||||||
public String propName;
|
String propName;
|
||||||
protected String columnName;
|
String columnName;
|
||||||
|
|
||||||
public int reftype;
|
int reftype;
|
||||||
|
|
||||||
public Constraint[] constraints;
|
Constraint[] constraints;
|
||||||
|
|
||||||
public boolean virtual;
|
boolean virtual;
|
||||||
public boolean readonly;
|
boolean readonly;
|
||||||
public boolean aggressiveLoading;
|
boolean aggressiveLoading;
|
||||||
public boolean aggressiveCaching;
|
boolean aggressiveCaching;
|
||||||
public boolean subnodesAreProperties;
|
boolean subnodesAreProperties;
|
||||||
public String accessor; // db column used to access objects through this relation
|
String accessor; // db column used to access objects through this relation
|
||||||
public String order;
|
String order;
|
||||||
public String groupbyorder;
|
String groupbyorder;
|
||||||
public String groupby;
|
String groupby;
|
||||||
public String prototype;
|
String prototype;
|
||||||
public String groupbyprototype;
|
String groupbyprototype;
|
||||||
public String filter;
|
String filter;
|
||||||
|
int maxSize = 0;
|
||||||
|
|
||||||
// Relation subnoderelation = null; // additional relation used to filter subnodes for virtual nodes
|
// Relation subnoderelation = null; // additional relation used to filter subnodes for virtual nodes
|
||||||
|
|
||||||
|
@ -74,6 +75,7 @@ public class Relation {
|
||||||
this.reftype = rel.reftype;
|
this.reftype = rel.reftype;
|
||||||
this.constraints = rel.constraints;
|
this.constraints = rel.constraints;
|
||||||
this.accessor = rel.accessor;
|
this.accessor = rel.accessor;
|
||||||
|
this.maxSize = rel.maxSize;
|
||||||
this.subnodesAreProperties = rel.subnodesAreProperties;
|
this.subnodesAreProperties = rel.subnodesAreProperties;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -241,6 +243,13 @@ public class Relation {
|
||||||
filter = props.getProperty (propName+".filter");
|
filter = props.getProperty (propName+".filter");
|
||||||
if (filter != null && filter.trim().length() == 0)
|
if (filter != null && filter.trim().length() == 0)
|
||||||
filter = null;
|
filter = null;
|
||||||
|
// get max size of collection
|
||||||
|
String max = props.getProperty (propName+".maxSize");
|
||||||
|
if (max != null) try {
|
||||||
|
maxSize = Integer.parseInt (max);
|
||||||
|
} catch (NumberFormatException nfe) {
|
||||||
|
maxSize = 0;
|
||||||
|
}
|
||||||
// get group by property
|
// get group by property
|
||||||
groupby = props.getProperty (propName+".groupby");
|
groupby = props.getProperty (propName+".groupby");
|
||||||
if (groupby != null && groupby.trim().length() == 0)
|
if (groupby != null && groupby.trim().length() == 0)
|
||||||
|
|
Loading…
Add table
Reference in a new issue