One2OneUnidirectAssociationJoin
One2OneUnidirectAssociationFk
One2OneBidirectAssociationJoin
One2ManyUnidirectAssociationJoinMember
One2ManyUnidirectAssociationFk
One2ManyAndMany2OneBidirectAssociation
One2ManyAndMany2OneBidirectAssociationJoin
Many2OneUnidirectAssociationJoin
Many2OneUnidirectAssociationFk
Many2ManyUnidirectAssociationJoin
Many2ManyBidirectAssociationJoin
package com.todd; import org.hibernate.SessionFactory; import org.hibernate.cfg.AnnotationConfiguration; public class HibernateAnnotationHelper { private static SessionFactory sessionFactory; static { try { sessionFactory = new AnnotationConfiguration().configure().buildSessionFactory();
} catch (Throwable ex) { throw new ExceptionInInitializerError(ex); } } public static SessionFactory getSessionFactory() { return sessionFactory; } public static void close() { getSessionFactory().close(); } }
0 意見:
張貼留言