-
1. Re: Cannot get the Package History in a content of deployment.
jayshaughnessy Jul 15, 2013 3:21 PM (in response to guillo)The reason for this, I think, is that pack.getPackageVersion() does return the PackageVersion, but not its lazy loaded data, like package history.
Perhaps try something like this:
...
PackageVersionCriteria c = new PackageVersionCriteria();
c.addFilterId( pack.getPackageVersion().getId() );
c.fetchInstalledPackageHistory( true );
PackageVersion pv = remoteClient.getContentManager().findPackageVersionsByCriteria( subject, c ).get(0); // assumes a single result, may want to protect against null here
pv.getInstalledPackageHistory(); // should be there, I think
-
2. Re: Cannot get the Package History in a content of deployment.
guillo Jul 16, 2013 10:00 AM (in response to jayshaughnessy)Wow!
It worked fine.
thank you very much.
-
3. Re: Cannot get the Package History in a content of deployment.
jayshaughnessy Jul 16, 2013 10:12 AM (in response to guillo)You're welcome. In short the "getters" on the entity objects will not have any of the lazy loaded data, for efficiency reasons we don't pull everything at all times. We have a whole bunch of "Criteria" objects and methods that allow you to perform fetches with powerful filtering (c.addFilterXXX) and also the ability to request optional data (c.fetchXXX).
The Criteria stuff is really useful when using the RHQ Remote API and CLI.
See https://docs.jboss.org/author/display/RHQ/Criteria+API+Tips for more!