Java Reference
In-Depth Information
public String getPublisher() {
return publisher;
}
public void setPublisher(String publisher) {
this.publisher = publisher;
}
public String getDate() {
return date;
}
public void setDate(String date) {
this.date = date;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
}
Creating a Persistence Configuration file
An EJB 3.0 entity bean is required to have a persistence.xml configuration file,
which defines the database persistence properties. A persistence.xml file gets
added to the META-INF folder when a JPA project is defined. Copy the following
listing to the persistence.xml file in Eclipse:
<?xml version="1.0" encoding="UTF-8" ?>
<persistence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
xmlns="http://java.sun.com/xml/ns/persistence" version="1.0">
<persistence-unit name="em">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<jta-data-source>jdbc/MySQLDS</jta-data-source>
<class>ejb3.Catalog</class>
<properties>
 
Search WWH ::




Custom Search