[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[eclipselink-dev] @ReturnInsert annotaion on primary key derived out of virtual column
- From: Ravi babu Tummuru <ravi.babu.tummuru@xxxxxxxxxx>
- Date: Mon, 5 Aug 2019 20:20:07 -0700
- Delivered-to: firstname.lastname@example.org
- Organization: Oracle Corporation
- User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0
ÂÂÂ I have a virtual column which is very important for our database
and every table who has that virtual column presents problems on
generated joins by Named Queries.
The virtual column is part of primary key. However, it's a non
updatable field. I couldn't map the column inside @EmbeddedId on Java
Java entities example.
The virtual column name is DIA_DT_RECIBO.
Its value is defined by another column value named DT_RECIBO. Its default
value is TO_NUMBER(TO_CHAR("DT_RECIBO",'DD')).
The code is outside the PK -> TbReciboNfce.java and
They resolved the issue by adding below code
> On virtual column inside the PK:
ReturnInsert(returnOnly = true)
Column(name = "DIA_DT_RECIBO")
private long diaDtRecibo;
-> On join:
JoinColumn(name = "DIA_DT_RECIBO", referencedColumnName = "DIA_DT_RECIBO",
insertable = false, updatable = false)
Is this a OK solution to use...?Â I don't see any issue there, but need
confirmation from u too.