天天看點

JavaPersistenceWithHibernate第二版筆記Getting started with ORM-001用JPA和Hibernate實作HellowWorld(JTA、Bitronix)

一、結構

JavaPersistenceWithHibernate第二版筆記Getting started with ORM-001用JPA和Hibernate實作HellowWorld(JTA、Bitronix)

二、model層

1.

三、配置檔案

1.persistence.xml(這個檔案似乎不起作用)

For the “Hello World” application, you delegate database connection handling to a Java Transaction API ( JTA ) provider, the open source Bitronix project. Bitronix offers connection pooling with a managed java.sql.DataSource and the standard javax.transaction.UserTransaction API in any Java SE environment. Bitronix binds

these objects into JNDI , and Hibernate interfaces automatically with Bitronix through JNDI lookups.

2.jndi.properties(這個檔案似乎不起作用)

四、測試檔案

2.

3.

4.

5.

You can do anything you set your mind to, man!