-1
도와 주시겠습니까? 저는 Grails에서 새로 왔습니다. 나는 grails doc을 읽었지 만 제 질문에 대한 답을 찾지 못했습니다.Grails 실현 관계
클래스 고객 : 패키지 테스트
class Customer {
int points
static hasMany = [pr:Product]
List pr;
static constraints = {
}
}
일류 상품 :
package test
class Product {
String question
int points
static belongsTo = [c:Customer]
static constraints = {
}
우리는 많은 관계로 하나가 볼 수 있듯이. 그럼 한 고객에게 제품을 많이 추가 할 :
def cust = new Customer()
def pr = new Product();
cust.pr=new ArrayList();
cust.pr.add(pr);
이 정확하게 실현인가?
무엇이 질문입니까? – j4y
내 문제를 해결했습니다. – Klesk