S2HibernateJPAのサンプル作成スタート


簡単にできると思っていたが、早くもつまずいた。
joinの自動生成がうまくいかないっす。


JPAの知識足りなすぎ・・
どのアノテーションがどうなるのかがわかってない。

こんな感じじゃないのかな?
    @JoinColumn(name="deptno")
    @OneToMany(mappedBy="dept")
    private Department department;
Hibernate: 
    select
        employee0_.empno as empno1_0_,
        employee0_.deptno as deptno1_0_,
        employee0_.ename as ename1_0_,
        employee0_.job as job1_0_,
        employee0_.mgr as mgr1_0_,
        employee0_.hiredate as hiredate1_0_,
        employee0_.sal as sal1_0_,
        employee0_.comm as comm1_0_,
        employee0_.department as department1_0_,
        employee0_.tstamp as tstamp1_0_ 
    from
        emp employee0_ 
    where
        employee0_.empno=?
DEBUG 2006-04-29 16:41:01,926 [main] 物理的なコネクションを閉じました
2006-04-29 16:41:01,966 [main] WARN  org.hibernate.util.JDBCExceptionReporter - SQL Error: -28, SQLState: S0022
2006-04-29 16:41:01,966 [main] ERROR org.hibernate.util.JDBCExceptionReporter - Column not found: EMPLOYEE0_.DEPARTMENT in statement [select employee0_.empno as empno1_0_, employee0_.deptno as deptno1_0_, employee0_.ename as ename1_0_, employee0_.job as job1_0_, employee0_.mgr as mgr1_0_, employee0_.hiredate as hiredate1_0_, employee0_.sal as sal1_0_, employee0_.comm as comm1_0_, employee0_.department as department1_0_, employee0_.tstamp as tstamp1_0_ from emp employee0_ where employee0_.empno=?]
2006-04-29 16:41:01,976 [main] INFO  org.hibernate.event.def.DefaultLoadEventListener - Error performing load command
org.hibernate.exception.SQLGrammarException: could not load an entity: [examples.jsf.entityjpa.Employee#7369]
	at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:65)
	at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)