Citation:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-reverse-engineering PUBLIC "-//Hibernate/Hibernate Reverse Engineering DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-reverse-engineering-3.0.dtd">
<hibernate-reverse-engineering>
<schema-selection match-catalog="pfe"/>
<table-filter match-name="bloc_image"/>
<table-filter match-name="image"/>
<table-filter match-name="personne"/>
</hibernate-reverse-engineering>
Citation:
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package hibernate;
import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.SessionFactory;
/**
* Hibernate Utility class with a convenient method to get Session Factory object.
*
* @author majed
*/
public class NewHibernateUtil {
private static final SessionFactory sessionFactory;
static {
try {
// Create the SessionFactory from standard (hibernate.cfg.xml)
// config file.
sessionFactory = new AnnotationConfiguration().configure().buildSessionFactory();
} catch (Throwable ex) {
// Log the exception.
System.err.println("Initial SessionFactory creation failed." + ex);
throw new ExceptionInInitializerError(ex);
}
}
public static SessionFactory getSessionFactory() {
return sessionFactory;
}
}
Citation:
package hibernate;
// Generated 15 avr. 2010 16:55:45 by Hibernate Tools 3.2.1.GA
import java.util.HashSet;
import java.util.Set;
/**
* Personne generated by hbm2java
*/
public class Personne implements java.io.Serializable {
private int idpersonne;
private String nomPersonne;
private String prenonPersonne;
private String poste;
private Set images = new HashSet(0);
public Personne() {
}
public Personne(int idpersonne) {
this.idpersonne = idpersonne;
}
public Personne(int idpersonne, String nomPersonne, String prenonPersonne, String poste) {
this.idpersonne = idpersonne;
this.nomPersonne = nomPersonne;
this.prenonPersonne = prenonPersonne;
this.poste = poste;
}
protected String string;
/**
* Get the value of string
*
* @return the value of string
*/
public String getString() {
return string;
}
/**
* Set the value of string
*
* @param string new value of string
*/
public void setString(String string) {
this.string = string;
}
public Personne(int idpersonne, String nomPersonne, String prenonPersonne, String poste, Set images) {
this.idpersonne = idpersonne;
this.nomPersonne = nomPersonne;
this.prenonPersonne = prenonPersonne;
this.poste = poste;
this.images = images;
}
public int getIdpersonne() {
return this.idpersonne;
}
public int getIdpersonne(int idpersonne) {
this.idpersonne = idpersonne;
return this.idpersonne;
}
public String getNomPersonne() {
return this.nomPersonne;
}
public void setNomPersonne(String nomPersonne) {
this.nomPersonne = nomPersonne;
}
public String getPrenonPersonne() {
return this.prenonPersonne;
}
public void setPrenonPersonne(String prenonPersonne) {
this.prenonPersonne = prenonPersonne;
}
public String getPoste() {
return this.poste;
}
public void setPoste(String poste) {
this.poste = poste;
}
public Set getImages() {
return this.images;
}
public void setImages(Set images) {
this.images = images;
}
}