thanks for your reply, this is the informations required
the context :
Spring-boot 1.3.2.RELEASE
Jpa 2.1
Hibernate 5.1.0.Final
sqlserver 2005
jpa properties :
hibernate.hbm2ddl=validate
hibernate.default_catalog=PARAM_PM_DEV
hibernate.connection.default_schema=PARAMETRAGE_TARIFAIRE
jdbc.driver=com.microsoft.sqlserver.jdbc.SQLServerDriver
jdbc.url=jdbc:sqlserver://127.0.0.1:1433;shutdown=false
the entity mappings :
Code:
@Entity
@Table(name = "ZONE_GEOGRAPHIQUE_ZGE", schema = "LOCALISATION")
public class PTAZoneGeographique {
/** Identifiant technique de la zone géographique. */
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "ZGE_ID")
protected Integer id;
@OneToMany(cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.LAZY)
@Fetch(FetchMode.SELECT)
@BatchSize(size = 250)
@JoinTable(schema = "LOCALISATION", name = "ZG_COMMUNES_ZGC", joinColumns = @JoinColumn(name = "ZGC_ZONE_GEOGRAPHIQUE_ID", referencedColumnName = "ZGE_ID"), inverseJoinColumns = @JoinColumn(name = "ZGC_COMMUNE_ID", referencedColumnName = "COM_ID"))
protected List<PTACommune> communes = new LinkedList<>();
Code:
@Entity
@Table(schema = "LOCALISATION", name = "COMMUNE_COM")
public class PTACommune {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "COM_ID")
protected Integer id;
@Column(name = "COM_CODE_INSEE", nullable = false)
private String codeINSEE;
@Column(name = "COM_LIBELLE", nullable = false)
private String libelle;