I am using following code to get Enum value from datamanager, but getting error ClassCastException: java.lang.String cannot be cast to com.sheel.environmentengineer.entity.EnumTargetType
This is my code
//get parameter monitoring type
EnumTargetType tt = dataManager.loadValue(
"select o.standardType from environmentengineer_EffluentStreamParameter o " +
"where o.effluentStream = :eff and o.parameter = :par", EnumTargetType.class)
.parameter("eff", ef)
.parameter("par", pa)
.one();
This looks that only scalar values can be returned this way.
Only number types are converted automatically (this is stated in the Javadocs). Now I see that we could also safely convert enums, but we cannot make this improvement in the current version as it will break compatibility. Created issue.