簡體   English   中英

JPA where子句條件

[英]JPA where clause condition

我在hbm.xml文件的此映射中使用了休眠3:

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

關鍵是where ,我該如何使用JPA 2.0 (作為提供商的Hibernate 4.1.9 final)做同樣的事情。

您可以使用@where批注,有關詳細信息,請參見此鏈接:

休眠@Where子句

例如,您的實體如下所示:

@Entity
@Table(name = "mtl_material_transactions", schema="apps")
@Where(clause="transaction_type_id in (35,44,90)")
public class MaterialTransaction {
   ...
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM