Database Connectivity: JDBC, JPA, and New Features
1. Locating Entities with Composite Primary Keys
When locating an entity with a composite primary key, an instance of the custom primary key class must be passed as the second argument of the EntityManager.find() method. The fields of this instance should be populated with the appropriate values for each field that is part of the primary key.
2. Java Persistence Query Language (JPQL)
2.1. Introduction
When the primary key of an entity is not known in advance, the Java Persistence Query Language (JPQL) is used to search for entities by a field other than the primary key. JPQL is an SQL - like language for retrieving, updating, and deleting entities in a database. <
超级会员免费看
订阅专栏 解锁全文
557

被折叠的 条评论
为什么被折叠?



