Constancio Bringel Gomes Neto
unread,Nov 13, 2010, 9:33:03 AM11/13/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to hibernat...@googlegroups.com
Pessoal estou com algumas dificuldades em fazer um relacionamento one to many usando hibernate 3.5, a exception gerada é:
log4j:WARN No appenders could be found for logger (org.hibernate.cfg.annotations.Version).
log4j:WARN Please initialize the log4j system properly.
Exception in thread "main" java.lang.NoSuchMethodError: javax.persistence.OneToMany.orphanRemoval()Z
at org.hibernate.cfg.AnnotationBinder.processElementAnnotations(AnnotationBinder.java:1830)
at org.hibernate.cfg.AnnotationBinder.processIdPropertiesIfNotAlready(AnnotationBinder.java:762)
at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:726)
at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:636)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:359)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1377)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:954)
at br.com.caelum.vraptor.exoclinica.testes.AdicaoDeAnimal.main(AdicaoDeAnimal.java:15)
minhas classes:
CLIENTE
@Entity
@Table(name = "cliente")
public class Cliente {
@Id
@GeneratedValue
@Column(name = "cod_cliente")
private Long cliente;
@OneToMany(targetEntity=Animal.class ,cascade = CascadeType.ALL,
fetch = FetchType.EAGER, mappedBy="cliente")
private List<Animal> animais;
ANIMAL
@Entity
@Table(name="animal")
public class Animal {
@Id
@GeneratedValue
@Column(name="cod_animal")
private Long animal;
@ManyToOne
@JoinColumn(name="cod_cliente")
private Cliente cliente;
Alguem tem alguma sugestão? já pesquisei bastante e até agora nada.
desde já agradeço.