使用hibernate工具从DB Tables(sql server)生成我的Pojo类后,我遇到了主键都是独特标识符的问题,经过多次研究和代码的中间化后我终于得到了这个例外我无法做到这一点找到一个解决方案,这里是一个Pojo classe的例子(所有的id在其他pojos中声明相同)
package model;
// Generated Apr 4, 2014 9:12:15 AM by Hibernate Tools 3.4.0.CR1
import java.io.Serializable;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.UniqueConstraint;
import org.hibernate.annotations.GenericGenerator;
/**
* Affectation generated by hbm2java
*/
@Entity
@Table(name = "Affectation", schema = "dbo", catalog = "TSIERP", uniqueConstraints = @UniqueConstraint(columnNames = "Code"))
public class Affectation implements java.io.Serializable {
private String uid;
private Date dateModif;
private Serializable modifUser;
private Serializable creationUser;
private Serializable libelle;
private Boolean valid;
private Date dateSaisie;
private Serializable code;
private Integer nbrMission;
private Double pourcentage;
private Serializable observation;
private String structure;
private Serializable responsable;
private Serializable libelleAr;
private Serializable libelleFr;
private Serializable observationAr;
private Serializable observationFr;
private String compteComptableAchat;
private String compteComptableVente;
private Serializable typeAffectation;
private Boolean suiviStock;
private Boolean vehicule;
private String lieuAffectation;
private Set<Personne> personnes = new HashSet<Personne>(0);
public Affectation() {
}
public Affectation(String uid) {
this.uid = uid;
}
public Affectation(String uid, Date dateModif, Serializable modifUser,
Serializable creationUser, Serializable libelle, Boolean valid,
Date dateSaisie, Serializable code, Integer nbrMission,
Double pourcentage, Serializable observation, String structure,
Serializable responsable, Serializable libelleAr,
Serializable libelleFr, Serializable observationAr,
Serializable observationFr, String compteComptableAchat,
String compteComptableVente, Serializable typeAffectation,
Boolean suiviStock, Boolean vehicule, String lieuAffectation,
Set<Personne> personnes) {
this.uid = uid;
this.dateModif = dateModif;
this.modifUser = modifUser;
this.creationUser = creationUser;
this.libelle = libelle;
this.valid = valid;
this.dateSaisie = dateSaisie;
this.code = code;
this.nbrMission = nbrMission;
this.pourcentage = pourcentage;
this.observation = observation;
this.structure = structure;
this.responsable = responsable;
this.libelleAr = libelleAr;
this.libelleFr = libelleFr;
this.observationAr = observationAr;
this.observationFr = observationFr;
this.compteComptableAchat = compteComptableAchat;
this.compteComptableVente = compteComptableVente;
this.typeAffectation = typeAffectation;
this.suiviStock = suiviStock;
this.vehicule = vehicule;
this.lieuAffectation = lieuAffectation;
this.personnes = personnes;
}
@Id
@GeneratedValue(generator = "uuid")
@GenericGenerator(name = "uuid", strategy = "uuid")
@Column(name = "UID", unique = true,nullable = false, length = 36)
public String getUid() {
return this.uid;
}
public void setUid(String uid) {
this.uid = uid;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "DateModif", length = 23)
public Date getDateModif() {
return this.dateModif;
}
public void setDateModif(Date dateModif) {
this.dateModif = dateModif;
}
@Column(name = "ModifUser")
public Serializable getModifUser() {
return this.modifUser;
}
public void setModifUser(Serializable modifUser) {
this.modifUser = modifUser;
}
@Column(name = "CreationUser")
public Serializable getCreationUser() {
return this.creationUser;
}
public void setCreationUser(Serializable creationUser) {
this.creationUser = creationUser;
}
@Column(name = "Libelle")
public Serializable getLibelle() {
return this.libelle;
}
public void setLibelle(Serializable libelle) {
this.libelle = libelle;
}
@Column(name = "Valid")
public Boolean getValid() {
return this.valid;
}
public void setValid(Boolean valid) {
this.valid = valid;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "DateSaisie", length = 23)
public Date getDateSaisie() {
return this.dateSaisie;
}
public void setDateSaisie(Date dateSaisie) {
this.dateSaisie = dateSaisie;
}
@Column(name = "Code", unique = true)
public Serializable getCode() {
return this.code;
}
public void setCode(Serializable code) {
this.code = code;
}
@Column(name = "NbrMission")
public Integer getNbrMission() {
return this.nbrMission;
}
public void setNbrMission(Integer nbrMission) {
this.nbrMission = nbrMission;
}
@Column(name = "Pourcentage", precision = 53, scale = 0)
public Double getPourcentage() {
return this.pourcentage;
}
public void setPourcentage(Double pourcentage) {
this.pourcentage = pourcentage;
}
@Column(name = "Observation")
public Serializable getObservation() {
return this.observation;
}
public void setObservation(Serializable observation) {
this.observation = observation;
}
@Column(name = "Structure", length = 36)
public String getStructure() {
return this.structure;
}
public void setStructure(String structure) {
this.structure = structure;
}
@Column(name = "Responsable")
public Serializable getResponsable() {
return this.responsable;
}
public void setResponsable(Serializable responsable) {
this.responsable = responsable;
}
@Column(name = "LibelleAR")
public Serializable getLibelleAr() {
return this.libelleAr;
}
public void setLibelleAr(Serializable libelleAr) {
this.libelleAr = libelleAr;
}
@Column(name = "LibelleFR")
public Serializable getLibelleFr() {
return this.libelleFr;
}
public void setLibelleFr(Serializable libelleFr) {
this.libelleFr = libelleFr;
}
@Column(name = "ObservationAR")
public Serializable getObservationAr() {
return this.observationAr;
}
public void setObservationAr(Serializable observationAr) {
this.observationAr = observationAr;
}
@Column(name = "ObservationFR")
public Serializable getObservationFr() {
return this.observationFr;
}
public void setObservationFr(Serializable observationFr) {
this.observationFr = observationFr;
}
@Column(name = "CompteComptableAchat", length = 36)
public String getCompteComptableAchat() {
return this.compteComptableAchat;
}
public void setCompteComptableAchat(String compteComptableAchat) {
this.compteComptableAchat = compteComptableAchat;
}
@Column(name = "CompteComptableVente", length = 36)
public String getCompteComptableVente() {
return this.compteComptableVente;
}
public void setCompteComptableVente(String compteComptableVente) {
this.compteComptableVente = compteComptableVente;
}
@Column(name = "TypeAffectation")
public Serializable getTypeAffectation() {
return this.typeAffectation;
}
public void setTypeAffectation(Serializable typeAffectation) {
this.typeAffectation = typeAffectation;
}
@Column(name = "SuiviStock")
public Boolean getSuiviStock() {
return this.suiviStock;
}
public void setSuiviStock(Boolean suiviStock) {
this.suiviStock = suiviStock;
}
@Column(name = "Vehicule")
public Boolean getVehicule() {
return this.vehicule;
}
public void setVehicule(Boolean vehicule) {
this.vehicule = vehicule;
}
@Column(name = "LieuAffectation", length = 36)
public String getLieuAffectation() {
return this.lieuAffectation;
}
public void setLieuAffectation(String lieuAffectation) {
this.lieuAffectation = lieuAffectation;
}
@OneToMany(fetch = FetchType.LAZY, mappedBy = "affectation")
public Set<Personne> getPersonnes() {
return this.personnes;
}
public void setPersonnes(Set<Personne> personnes) {
this.personnes = personnes;
}
}
这是我得到的例外
SEVERE: Servlet.service() for servlet [action] in context with path [/Projet] threw exception [Request processing failed; nested exception is org.hibernate.type.SerializationException: could not deserialize] with root cause
java.io.StreamCorruptedException: invalid stream header: 30003100
at java.io.ObjectInputStream.readStreamHeader(Unknown Source)
at java.io.ObjectInputStream.<init>(Unknown Source)
at org.hibernate.util.SerializationHelper$CustomObjectInputStream.<init>(SerializationHelper.java:252)
at org.hibernate.util.SerializationHelper.deserialize(SerializationHelper.java:209)
at org.hibernate.util.SerializationHelper.deserialize(SerializationHelper.java:240)
at org.hibernate.type.SerializableType.fromBytes(SerializableType.java:82)
at org.hibernate.type.SerializableType.get(SerializableType.java:39)
at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:163)
at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:154)
at org.hibernate.type.AbstractType.hydrate(AbstractType.java:81)
at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2101)
at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1380)
at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1308)
at org.hibernate.loader.Loader.getRow(Loader.java:1206)
at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:580)
at org.hibernate.loader.Loader.doQuery(Loader.java:701)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
at org.hibernate.loader.Loader.doList(Loader.java:2213)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
at org.hibernate.loader.Loader.list(Loader.java:2099)
at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:289)
at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1695)
at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:142)
at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:152)
at dao.affectation.AffectationImpl.getAll(AffectationImpl.java:29)
at services.affectation.AffectationMetierImpl.getAll(AffectationMetierImpl.java:29)
at controllers.NRubriquesPaieController.AffichageRapport(NRubriquesPaieController.java:69)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176)
at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:440)
at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:428)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:936)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:838)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:154)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:110)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:50)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:315)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
我希望你能帮我解决这个问题,我一直在寻找太久而且不知道该怎么做。
答案 0 :(得分:2)
我终于通过将Serializable类型更改为String来解决问题,我不知道为什么但是hibernate工具出错了我希望通过发布它来帮助某人它真的是一个愚蠢的例外但我花了好几个小时才解决。
package model;
// Generated Apr 4, 2014 9:12:15 AM by Hibernate Tools 3.4.0.CR1
import java.io.Serializable;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.UniqueConstraint;
import org.hibernate.annotations.GenericGenerator;
/**
* Affectation generated by hbm2java
*/
@Entity
@Table(name = "Affectation", schema = "dbo", catalog = "TSIERP", uniqueConstraints = @UniqueConstraint(columnNames = "Code"))
public class Affectation implements java.io.Serializable {
private String uid;
private Date dateModif;
private String modifUser;
private String creationUser;
private String libelle;
private Boolean valid;
private Date dateSaisie;
private String code;
private Integer nbrMission;
private Double pourcentage;
private String observation;
private String structure;
private String responsable;
private String libelleAr;
private String libelleFr;
private String observationAr;
private String observationFr;
private String compteComptableAchat;
private String compteComptableVente;
private String typeAffectation;
private Boolean suiviStock;
private Boolean vehicule;
private String lieuAffectation;
private Set<Personne> personnes = new HashSet<Personne>(0);
public Affectation() {
}
public Affectation(String uid) {
this.uid = uid;
}
public Affectation(String uid, Date dateModif, String modifUser,
String creationUser, String libelle, Boolean valid,
Date dateSaisie, String code, Integer nbrMission,
Double pourcentage, String observation, String structure,
String responsable, String libelleAr,
String libelleFr, String observationAr,
String observationFr, String compteComptableAchat,
String compteComptableVente, String typeAffectation,
Boolean suiviStock, Boolean vehicule, String lieuAffectation,
Set<Personne> personnes) {
this.uid = uid;
this.dateModif = dateModif;
this.modifUser = modifUser;
this.creationUser = creationUser;
this.libelle = libelle;
this.valid = valid;
this.dateSaisie = dateSaisie;
this.code = code;
this.nbrMission = nbrMission;
this.pourcentage = pourcentage;
this.observation = observation;
this.structure = structure;
this.responsable = responsable;
this.libelleAr = libelleAr;
this.libelleFr = libelleFr;
this.observationAr = observationAr;
this.observationFr = observationFr;
this.compteComptableAchat = compteComptableAchat;
this.compteComptableVente = compteComptableVente;
this.typeAffectation = typeAffectation;
this.suiviStock = suiviStock;
this.vehicule = vehicule;
this.lieuAffectation = lieuAffectation;
this.personnes = personnes;
}
@Id
@GenericGenerator(name = "generator", strategy = "guid", parameters = {})
@GeneratedValue(generator = "generator")
@Column(name = "UID", unique = true,nullable = false, length = 36, columnDefinition="uniqueidentifier")
public String getUid() {
return this.uid;
}
public void setUid(String uid) {
this.uid = uid;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "DateModif", length = 23)
public Date getDateModif() {
return this.dateModif;
}
public void setDateModif(Date dateModif) {
this.dateModif = dateModif;
}
@Column(name = "ModifUser")
public String getModifUser() {
return this.modifUser;
}
public void setModifUser(String modifUser) {
this.modifUser = modifUser;
}
@Column(name = "CreationUser")
public String getCreationUser() {
return this.creationUser;
}
public void setCreationUser(String creationUser) {
this.creationUser = creationUser;
}
@Column(name = "Libelle")
public String getLibelle() {
return this.libelle;
}
public void setLibelle(String libelle) {
this.libelle = libelle;
}
@Column(name = "Valid")
public Boolean getValid() {
return this.valid;
}
public void setValid(Boolean valid) {
this.valid = valid;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "DateSaisie", length = 23)
public Date getDateSaisie() {
return this.dateSaisie;
}
public void setDateSaisie(Date dateSaisie) {
this.dateSaisie = dateSaisie;
}
@Column(name = "Code", unique = true)
public String getCode() {
return this.code;
}
public void setCode(String code) {
this.code = code;
}
@Column(name = "NbrMission")
public Integer getNbrMission() {
return this.nbrMission;
}
public void setNbrMission(Integer nbrMission) {
this.nbrMission = nbrMission;
}
@Column(name = "Pourcentage", precision = 53, scale = 0)
public Double getPourcentage() {
return this.pourcentage;
}
public void setPourcentage(Double pourcentage) {
this.pourcentage = pourcentage;
}
@Column(name = "Observation")
public String getObservation() {
return this.observation;
}
public void setObservation(String observation) {
this.observation = observation;
}
@Column(name = "Structure", length = 36)
public String getStructure() {
return this.structure;
}
public void setStructure(String structure) {
this.structure = structure;
}
@Column(name = "Responsable")
public String getResponsable() {
return this.responsable;
}
public void setResponsable(String responsable) {
this.responsable = responsable;
}
@Column(name = "LibelleAR")
public String getLibelleAr() {
return this.libelleAr;
}
public void setLibelleAr(String libelleAr) {
this.libelleAr = libelleAr;
}
@Column(name = "LibelleFR")
public String getLibelleFr() {
return this.libelleFr;
}
public void setLibelleFr(String libelleFr) {
this.libelleFr = libelleFr;
}
@Column(name = "ObservationAR")
public String getObservationAr() {
return this.observationAr;
}
public void setObservationAr(String observationAr) {
this.observationAr = observationAr;
}
@Column(name = "ObservationFR")
public String getObservationFr() {
return this.observationFr;
}
public void setObservationFr(String observationFr) {
this.observationFr = observationFr;
}
@Column(name = "CompteComptableAchat", length = 36)
public String getCompteComptableAchat() {
return this.compteComptableAchat;
}
public void setCompteComptableAchat(String compteComptableAchat) {
this.compteComptableAchat = compteComptableAchat;
}
@Column(name = "CompteComptableVente", length = 36)
public String getCompteComptableVente() {
return this.compteComptableVente;
}
public void setCompteComptableVente(String compteComptableVente) {
this.compteComptableVente = compteComptableVente;
}
@Column(name = "TypeAffectation")
public String getTypeAffectation() {
return this.typeAffectation;
}
public void setTypeAffectation(String typeAffectation) {
this.typeAffectation = typeAffectation;
}
@Column(name = "SuiviStock")
public Boolean getSuiviStock() {
return this.suiviStock;
}
public void setSuiviStock(Boolean suiviStock) {
this.suiviStock = suiviStock;
}
@Column(name = "Vehicule")
public Boolean getVehicule() {
return this.vehicule;
}
public void setVehicule(Boolean vehicule) {
this.vehicule = vehicule;
}
@Column(name = "LieuAffectation", length = 36)
public String getLieuAffectation() {
return this.lieuAffectation;
}
public void setLieuAffectation(String lieuAffectation) {
this.lieuAffectation = lieuAffectation;
}
@OneToMany(fetch = FetchType.LAZY, mappedBy = "affectation")
public Set<Personne> getPersonnes() {
return this.personnes;
}
public void setPersonnes(Set<Personne> personnes) {
this.personnes = personnes;
}
}
答案 1 :(得分:1)
基本上@ Bacem-IJ将所有Serializable对象更改为String。这个问题也可能来自缺少hibernate-java8
lib。