If you were logged in you would be able to see more operations.
|
|
|
QuickBuild
Created: 27/Jul/12 08:33 AM
Updated: 31/Jul/12 11:07 AM
|
|
Component/s: |
None
|
Affects Version/s: |
4.0.14
|
Fix Version/s: |
None
|
|
Original Estimate:
|
Unknown
|
Remaining Estimate:
|
Unknown
|
Time Spent:
|
Unknown
|
Environment:
|
unix
|
|
i want to get names of all child configurations under a given parent configuration recursively.
i tried :
1-configuration.getChildren()
2-configuration.getDescendents()
but i am not able to find the result:
i have used it like this-
config = system.getConfiguration("root/testing1");
logger.info(config.getChildren().toString());
but everytime it throws error like :
Caused by: com.pmease.quickbuild.QuickbuildException: org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.pmease.quickbuild.model.Configuration.children, no session or session was closed
at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:383)
at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:375)
|
Description
|
i want to get names of all child configurations under a given parent configuration recursively.
i tried :
1-configuration.getChildren()
2-configuration.getDescendents()
but i am not able to find the result:
i have used it like this-
config = system.getConfiguration("root/testing1");
logger.info(config.getChildren().toString());
but everytime it throws error like :
Caused by: com.pmease.quickbuild.QuickbuildException: org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.pmease.quickbuild.model.Configuration.children, no session or session was closed
at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:383)
at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:375) |
Show » |
|
import com.pmease.quickbuild.persistence.*;
SessionManager.openSession();
try {
def reloaded = system.configurationManager.load(<id of some configuration>);
for (child in reloaded.getDescendents()) {
// do something with the child.
}
} finally {
SessionManager.closeSession();
}