Java and performance
Assignment check: have you met any trouble in making the previous exercise?
JPA helps to solve those troubles
To place a class under the control of the JPA provider, you must map this class thanks to annotations
@Entity
@Table(name="IDENTITIES")
public class Identity { /*...*/ }
Column(name="displayName")
private String displayName;
hibernate.cfg.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration
PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">
org.apache.derby.jdbc.EmbeddedDriver
</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.connection.password">root</property>
<property name="hibernate.connection.url">jdbc:derby:/test</property>
<property name="hibernate.dialect">org.hibernate.dialect.DerbyDialect</property>
<property name="hibernate.show_sql">true</property>
<property name="hibernate.hbm2ddl.auto">update</property>
<mapping class="fr.tbr.iam.identity.Identity" />
</hibernate-configuration>