Tuesday, 15 January 2013

hibernate - Can I use JPA to populate fields with generated data (ie using a View)? -



hibernate - Can I use JPA to populate fields with generated data (ie using a View)? -

i've gotten work, partially, using view, i'm not sure if right approach.

i have database table, escrow, maps entity. created view, called escrow_derived, contains same columns table, has column defined as:

select count(*) escrow_access e.id=a.escrow , a.viewed=1) num_dirty

i modified entity point view, , added next attribute:

@column(name = "num_dirty") private integer numdirty;

retrieving info works great. problem when seek insert. next error:

internal exception: java.sql.sqlsyntaxerrorexception: ora-01733: virtual column not allowed here

i want entity have numdirty populated can utilize display purposes. using view allows me retrieve info single query.

is there way work?

hibernate jpa view insert

No comments:

Post a Comment