How to get last version by code
Hi.
How can i get last version of document (WTDocument or EPMDocument) by java code.
For example for A.2 version get latest, which is B.1 ?
Thanks.
Hi.
How can i get last version of document (WTDocument or EPMDocument) by java code.
For example for A.2 version get latest, which is B.1 ?
Thanks.
i'm using next code:
public static Object getLatestByConfigSpec(Mastered mastered, Iterated iterated) throws WTException
{
Object tempObject = null;
Object resultObject = null;
long id = 0;
QueryResult cQueryResult = ConfigHelper.service.filteredIterationsOf(mastered, ConfigHelper.service.getConfigSpecFor(iterated));
while(cQueryResult.hasMoreElements())
{
tempObject = cQueryResult.nextElement();
if(PersistenceHelper.getObjectIdentifier((Persistable) tempObject).getId() > id)
{
id = PersistenceHelper.getObjectIdentifier((Persistable) tempObject).getId();
resultObject = tempObject;
}
}
return resultObject;
}
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.