Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Data
- @Entity(name= "mv_garage_asset_mapping")
- public class GarageAssetMapping implements Serializable {
- /**
- *
- */
- private static final long serialVersionUID = 2535545189473989744L;
- @Id
- @Column(name="GARAGE_CODE")
- private String garageCode;
- @Column(name="CONTRACT_NUMBER")
- private String contractNumber;
- @OneToOne( fetch=FetchType.LAZY )
- @JoinColumn(name="CONTRACT_NUMBER", referencedColumnName = "hpano", insertable = false, updatable = false)
- @NotFound(action = NotFoundAction.IGNORE)
- private RepoAgentDetails repoAgentDetails;
- }
- @Entity
- public class RepoAgentDetails {
- @Column(name="hpano")
- private String hpano;
- @OneToOne(mappedBy = "repoAgentDetails", fetch = FetchType.LAZY)
- private GarageAssetMapping garageAssetMapping;
- }
- @Query("select new com.mf.acrs.garage.bean.AssetDetailsBean (ga.contractNumber as contractNumber, ra.create_date as createDate ) "
- + "from mv_garage_asset_mapping ga "
- + " inner join RepoAgentDetails ra on ga.contractNumber = ra.hpano"
- + " where ga.garageCode = ?1 ")
- List<AssetDetailsBean> findByGarageCode ( String garageCode );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement