我有沒有主鍵的數據庫視圖。它有一組唯一標識視圖中的一行的列,但其中三列可以是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