WAM Version 2.2 - Issue On ResourceTypeCharacteristicW1_Chandler.java

(Doc ID 2339471.1)

Last updated on DECEMBER 14, 2017

Applies to:

Oracle Utilities Work and Asset Management Enterprise Edition - Version and later
Information in this document applies to any platform.


On : version, System Wide

WAM Version 2.2 - Issue on ResourceTypeCharacteristicW1_Chandler.java

Error when adding a Stock Item:

org.hibernate.QueryException: could not resolve property: id.activity of: com.splwg.w1.domain.inventory.resourceType.entities.ResourceTypeCharacteristicW1_Per [select MAX(characteristic.id.sequence) from com.splwg.w1.domain.inventory.resourceType.entities.ResourceTypeCharacteristicW1_Per characteristic where characteristic.id.activity = :resourceType and characteristic.id.characteristicType = :charType /* ResourceTypeCharacteristicW1_CHandler */]

*** This is a base issue on code com.splwg.w1.domain.inventory.resourceType.entities.ResourceTypeCharacteristicW1_Chandler.java

On method getNextSequence:

// Method Start
  private BigInteger getNextSequence(ResourceTypeW1 resourceType, CharacteristicType charType)
  StringBuilder queryString = new StringBuilder();
  queryString.append("from ResourceTypeCharacteristicW1 characteristic ");
  queryString.append(" where characteristic.id.activity = :resourceType ");
  queryString.append("and characteristic.id.characteristicType = :charType");
  Query query = createQuery(queryString.toString(), getClass().getSimpleName());

  query.bindEntity("resourceType", resourceType);
  query.bindEntity("charType", charType);
  query.addResult("maxValue", "MAX(characteristic.id.sequence)");
  BigInteger result = (BigInteger)query.firstRow();
  if (result == null) {
  return BigInteger.ONE;
  return result.add(BigInteger.ONE);
// Method End

The query string should be:
  queryString.append(" where characteristic.id.resourceType = :resourceType ");
instead of :
  queryString.append(" where characteristic.id.activity = :resourceType ");


Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms