Skip to content

Commit

Permalink
RetrieveDbRecordsUtil: handle HUTraceType
Browse files Browse the repository at this point in the history
  • Loading branch information
teosarca committed Nov 27, 2018
1 parent 0047f63 commit 5a7862a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
Expand Up @@ -71,4 +71,15 @@ public enum HUTraceType
* Used for records/events related zo changes in the parent HU relation.
*/
TRANSFORM_PARENT
;

public static HUTraceType ofCode(final String code)
{
return valueOf(code);
}

public String getCode()
{
return name();
}
}
Expand Up @@ -60,7 +60,7 @@ public static HUTraceEvent fromDbRecord(@NonNull final I_M_HU_Trace dbRecord)
.inOutId(dbRecord.getM_InOut_ID())
.movementId(dbRecord.getM_Movement_ID())
.shipmentScheduleId(ShipmentScheduleId.ofRepoIdOrNull(dbRecord.getM_ShipmentSchedule_ID()))
.type(HUTraceType.valueOf(dbRecord.getHUTraceType())); // HUTraceType is also a mandatory column, so no NPE
.type(HUTraceType.ofCode(dbRecord.getHUTraceType())); // HUTraceType is also a mandatory column, so no NPE

if (dbRecord.getM_HU_Trace_ID() > 0)
{
Expand Down
Expand Up @@ -297,6 +297,11 @@ static IQueryBuilder<I_M_HU_Trace> createQueryBuilderOrNull(@NonNull final HUTra
queryBuilder.addEqualsFilter(I_M_HU_Trace.COLUMN_M_HU_Trace_ID, query.getHuTraceEventId().getAsInt());
queryIsEmpty = false;
}
if(query.getType() != null)
{
queryBuilder.addEqualsFilter(I_M_HU_Trace.COLUMN_HUTraceType, query.getType().getCode());
queryIsEmpty = false;
}
if (query.getOrgId() != null)
{
queryBuilder.addEqualsFilter(I_M_HU_Trace.COLUMN_AD_Org_ID, query.getOrgId());
Expand Down

0 comments on commit 5a7862a

Please sign in to comment.