* Add new getParentSetting() method that allows to retrieve the
unparsed, verbatim _parent option from the type.properties file.
This commit is contained in:
parent
1f362c1803
commit
c52a29741e
1 changed files with 19 additions and 7 deletions
|
@ -47,6 +47,9 @@ public final class DbMapping {
|
||||||
// name of db table
|
// name of db table
|
||||||
private String tableName;
|
private String tableName;
|
||||||
|
|
||||||
|
// the verbatim, unparsed _parent specification
|
||||||
|
private String parentSetting;
|
||||||
|
|
||||||
// list of properties to try for parent
|
// list of properties to try for parent
|
||||||
private ParentInfo[] parentInfo;
|
private ParentInfo[] parentInfo;
|
||||||
|
|
||||||
|
@ -203,16 +206,15 @@ public final class DbMapping {
|
||||||
protoField = props.getProperty("_prototype");
|
protoField = props.getProperty("_prototype");
|
||||||
evictOnReplication = "true".equals(props.getProperty("_evictOnReplication"));
|
evictOnReplication = "true".equals(props.getProperty("_evictOnReplication"));
|
||||||
|
|
||||||
String parentSpec = props.getProperty("_parent");
|
parentSetting = props.getProperty("_parent");
|
||||||
|
if (parentSetting != null) {
|
||||||
if (parentSpec != null) {
|
|
||||||
// comma-separated list of properties to be used as parent
|
// comma-separated list of properties to be used as parent
|
||||||
StringTokenizer st = new StringTokenizer(parentSpec, ",;");
|
StringTokenizer st = new StringTokenizer(parentSetting, ",;");
|
||||||
|
|
||||||
parentInfo = new ParentInfo[st.countTokens()];
|
parentInfo = new ParentInfo[st.countTokens()];
|
||||||
|
|
||||||
for (int i = 0; i < parentInfo.length; i++)
|
for (int i = 0; i < parentInfo.length; i++) {
|
||||||
parentInfo[i] = new ParentInfo(st.nextToken().trim());
|
parentInfo[i] = new ParentInfo(st.nextToken().trim());
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
parentInfo = null;
|
parentInfo = null;
|
||||||
}
|
}
|
||||||
|
@ -671,7 +673,17 @@ public final class DbMapping {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This returns the parent info array, which tells an object of this type how to
|
* @return the parent info as unparsed string.
|
||||||
|
*/
|
||||||
|
public String getParentSetting() {
|
||||||
|
if ((parentSetting == null) && (parentMapping != null)) {
|
||||||
|
return parentMapping.getParentSetting();
|
||||||
|
}
|
||||||
|
return parentSetting;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the parent info array, which tells an object of this type how to
|
||||||
* determine its parent object.
|
* determine its parent object.
|
||||||
*/
|
*/
|
||||||
public synchronized ParentInfo[] getParentInfo() {
|
public synchronized ParentInfo[] getParentInfo() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue