VIVO-672 Preserve the lazy initialization of the VClassJena.
Instead of a copy constructor on VClass, use a copy() method, which can be overridden.
This commit is contained in:
parent
0280cda8e3
commit
2f68ddb8ee
3 changed files with 37 additions and 21 deletions
|
@ -137,24 +137,30 @@ public class VClass extends BaseResourceBean implements Comparable<VClass>
|
||||||
/**
|
/**
|
||||||
* Constructs the VClass as a deep copy of an existing VClass.
|
* Constructs the VClass as a deep copy of an existing VClass.
|
||||||
*/
|
*/
|
||||||
public VClass( VClass vc) {
|
public VClass copy() {
|
||||||
this.URI = vc.URI;
|
VClass that = new VClass();
|
||||||
this.namespace = vc.namespace;
|
copyFields(that);
|
||||||
this.localName = vc.localName;
|
return that;
|
||||||
this.myName = vc.myName;
|
}
|
||||||
this.myExample = vc.myExample;
|
|
||||||
this.myDescription = vc.myDescription;
|
protected void copyFields(VClass that) {
|
||||||
this.myShortDefinition = vc.myShortDefinition;
|
that.myName = this.myName;
|
||||||
this.myEntityCount = vc.myEntityCount;
|
that.namespace = this.namespace;
|
||||||
this.displayLimit = vc.displayLimit;
|
that.localName = this.localName;
|
||||||
this.displayRank = vc.displayRank;
|
that.URI = this.URI;
|
||||||
this.quickEditJsp = vc.quickEditJsp;
|
that.myExample = this.myExample;
|
||||||
this.groupURI = vc.groupURI;
|
that.myDescription = this.myDescription;
|
||||||
this.group = (vc.group == null) ? null : new VClassGroup(vc.group);
|
that.myShortDefinition = this.myShortDefinition;
|
||||||
this.customEntryForm = vc.customEntryForm;
|
that.myEntityCount = this.myEntityCount;
|
||||||
this.customDisplayView = vc.customDisplayView;
|
that.displayLimit = this.displayLimit;
|
||||||
this.customShortView = vc.customShortView;
|
that.displayRank = this.displayRank;
|
||||||
this.customSearchView = vc.customSearchView;
|
that.quickEditJsp = this.quickEditJsp;
|
||||||
|
that.groupURI = this.groupURI;
|
||||||
|
that.group = this.group;
|
||||||
|
that.customEntryForm = this.customEntryForm;
|
||||||
|
that.customDisplayView = this.customDisplayView;
|
||||||
|
that.customShortView = this.customShortView;
|
||||||
|
that.customSearchView = this.customSearchView;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -37,8 +37,8 @@ public class VClassGroupsForRequest {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (log.isDebugEnabled()) {
|
if (log.isDebugEnabled()) {
|
||||||
log.debug("groups: " + groupMap);
|
log.debug("groups: " + groupMap.values());
|
||||||
log.debug("classes: " + classMap);
|
log.debug("classes: " + classMap.values());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ public class VClassGroupsForRequest {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadClass(VClass vc, VClassGroup newVcg) {
|
private void loadClass(VClass vc, VClassGroup newVcg) {
|
||||||
VClass newVc = new VClass(vc);
|
VClass newVc = vc.copy();
|
||||||
newVc.setName(getNameForVClass(vc));
|
newVc.setName(getNameForVClass(vc));
|
||||||
newVc.setGroup(newVcg);
|
newVc.setGroup(newVcg);
|
||||||
newVcg.add(newVc);
|
newVcg.add(newVc);
|
||||||
|
|
|
@ -47,6 +47,16 @@ public class VClassJena extends VClass {
|
||||||
this.webappDaoFactory = wadf;
|
this.webappDaoFactory = wadf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructs the VClassJena as a deep copy of an existing VClassJena.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public VClassJena copy() {
|
||||||
|
VClassJena that = new VClassJena(this.cls, this.webappDaoFactory);
|
||||||
|
copyFields(that);
|
||||||
|
return that;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* What this VClass is called
|
* What this VClass is called
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Reference in a new issue