我有没有主键的数据库视图。它有一组唯一标识视图中的一行的列,但其中三列可以是null。我试图创建基于这些四列的复合主键的实体,而是从视图中检索数据时出现此错误: The primary key read from the row ... during the execution of the query was detected to be null. Primary keys must not
假设我有两个实体:组织和用户。每个用户都可以成为许多组织的成员,并且每个组织都可以拥有许多用户。 @Entity
public class User {
@ManyToMany
Set<Organization> organizations;
//...
}
@Entity
public class Organization {
@ManyToMa
林学春数据+ JPA,创造类似的查询: public interface GroupRepository extends JpaRepository<Group, Integer> {
@Query("SELECT g.group, sum(ball) as sum from person ... group by ...", nativeQuery=false)
List<G