Entidade:
@Getter
@Setter
@NoArgsConstructor
@Entity
@ToString
@DynamicUpdate
@Table(name = "flow_plan_details")
public class FlowPlanDetails extends BaseEntity{
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@NotNull(groups = Existing.class)
@Null(groups = New.class)
private Long flowPlanId;
private Integer itemNbr;
private String itemDescription;
private String season;
private Integer fiscalYear;
private String catDesc;
private String subcatDesc;
private String gmm;
private String dmm;
private String planStatus;
private String channel;
private Boolean isLcl;
private String imageUrl;
private Integer carryOverItemNbr;
private Integer palletQty;
private Integer totalContQty;
private Integer commitmentQty;
private Integer defaultPresentation;
private LocalDate inClubDate;
private LocalDate oosDate;
private String eventCode;
private Integer clubCount;
private Integer percContainerRoundUp;
private String portOfOrigin;
private String productId;
private String flowRounding;
private String breakdownCalculation;
private Integer wos;
private Integer lastWeekToReceive;
private String targetOhRule;
private Float itemCost;
private Float itemRetail;
private Float shippingCostPerPallet;
private Float shippingCostPerContainer;
private Float profitPerItem;
private Float lostSale;
private Float containerShippingCost;
private Float totalCost;
private String holidayName;
private LocalDate holidayStartDate;
private LocalDate holidayEndDate;
private LocalDate holidayDate;
private String applyHoliday;
private Float plannedContainers;
private Float plannedPallets;
private Float flowContainers;
private Float flowPallets;
private Float differenceInContainers;
private Float differenceInPallets;
private LocalDateTime lastGeneratedFlowPlan;
private Long rolloutId;
private Boolean isRolloutRefreshRequired;
private Boolean isArchived = false;
private Float weight;
private Float dimension1;
private Float dimension2;
private Float dimension3;
private Boolean sorted;
private String impactDropdown;
private Boolean isReadyForScgs;
private String finalizedStatus;
public interface Existing {
}
public interface New {
}
public String getFlowplanIdWithName()
{
return this.getFlowPlanId().toString()+" - "+this.getItemDescription()+" - "+ this.getChannel();
}
}
Estou executando esta consulta:
@Query("""
select f from FlowPlanDetails f
where f.last_updated_on between :startDate and :endDate
and f.plan_status=:planStatus and f.is_archived=:isArchived
and f.cat_desc= :catDesc
""") //(:catDesc is NULL OR f.cat_desc= :catDesc)
Page<FlowPlanDetails> customSpotQuery(@Param("catDesc") String catDesc,
@Param("startDate") ZonedDateTime startDate,
@Param("endDate") ZonedDateTime endDate,
@Param("planStatus") String planStatus,
@Param("isArchived") Boolean isArchived, Pageable page);
Estou recebendo este erro:
Causado por: java.lang.IllegalArgumentException: org.hibernate.QueryException: não foi possível resolver a propriedade: last_updated_on de: com.walmart.sams.services.allocation.configuration.service.model.FlowPlanDetails [selecione f de com.walmart.sams.services.allocation.configuration.service.model.FlowPlanDetails f onde f.last_updated_on entre :startDate e :endDate e f.plan_status=:planStatus e f.is_archived=:isArchived e f.cat_desc= :catDesc]
Agora a coluna last_updated_on vem de BaseEntity. Como resolver isso?