Tuesday, 15 March 2011

java - JPA where clause condition -



java - JPA where clause condition -

i'm using hibernate 3 within mapping in hbm.xml file:

<class table="mtl_material_transactions" name="com.kaka.oracle.model.inventory.transactions.materialtransaction" where="transaction_type_id in (35,44,90)" schema="apps">

the key point where, how can same jpa 2.0 (hibernate 4.1.9 final provider).

you can utilize @where annotation, see link details:

hibernate @where clause

for illustration entity looks this:

@entity @table(name = "mtl_material_transactions", schema="apps") @where(clause="transaction_type_id in (35,44,90)") public class materialtransaction { ... }

java hibernate jpa

No comments:

Post a Comment