0

판별. 다음과 같이초기화 자식 클래스의 객체가 나는 부모 클래스가

데이터베이스 테이블은 다음과 같습니다

다음과 같이 이제
create table table_A(
ID integer(2), 
A1 integer(2), 
A2 integer(2), 
typeOfChild varchar2(8), 
primary key(ID)); 

나는 다른 클래스의 ContainerClass 있습니다

class ContainerClass{ 
.... 
List child1 = new ArrayList() 
List child2 = new ArrayList() 
.... 

static hasMany[] = [child1:Child1,child2:Child2] 

static mapping = { 
... 
child1 cascade : "all-delete-orphan" 
child2 cascade : "all-delete-orphan" 
} 

def getChild1List() { 
    return LazyList.decorate(child1, FactoryUtils.instantiateFactory(Child1.class)) 
} 
def getChild2List() { 
    return LazyList.decorate(child2, FactoryUtils.instantiateFactory(Child2.class)) 
} 

} 

을 지금은 ContainerClass의 객체를 만들고 또한 데이터베이스의 데이터가있을 때하는 I 가져올 필요가 있습니다. LazyList.decorate 함수는 하위 개체 목록을 초기화 할 수 없습니다.

org.springframework.dao.InvalidDataAccessResourceUsageException: could not initialize a collection: [###################################] 
    at java.lang.Thread.run(Thread.java:619) 
    Caused by: org.hibernate.exception.SQLGrammarException: could not initialize a collection:   
    Caused by: java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist 

    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:439) 
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:395) 
    at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:802) 
    at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:436) 
    at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:186) 
    at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:521) 
    at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:205) 
    at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:861) 
    at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1145) 
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1267) 
    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3449) 
    at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3493) 
    at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java: 
    at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:9 
    at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:9 
    ... 1 more 

Grails를 판별 매개 변수를 사용하여 이와 같은 어떤 아이 클래스에서 부모 클래스의 전체 테이블 매핑에 어떤 다른 방법이 있나요 다음과 같이 나는 예외가?

답변

관련 문제