• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

@Cascade annotation

 
Laura Barroso
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I'm facing this problem: I have a OneToMany relationship, here is my code:
@OneToMany(mappedBy = "school")
@Cascade(org.hibernate.annotations.CascadeType.DELETE_ORPHAN)
public List<Student> getStudents() {
return students;
}

public void setStudents(List<Student> students) {
this.students = students;
}
But..when I try to deploy my app netbeans says:
warning: Cannot find annotation method 'value()' in type 'org.hibernate.annotations.Cascade': class file for org.hibernate.annotations.Cascade not found
An exception has occurred in the compiler (1.6.0). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport) after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report. Thank you.
com.sun.tools.javac.code.Symbol$CompletionFailure: class file for org.hibernate.annotations.CascadeType not found

I don't know if it is a library that is missing or something else...anyone knows what could be happen???
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looks like the Hibernate library that contains this class is missing on your runtime classpath.

org.hibernate.annotations.CascadeType

Remember, your compile time classpath and runtime classpaths are different. It sounds like your compile time classpath is fine, but at runtime, things are misconfigured.

The CascadeType is just in the jar file that comes with the annotations download from Hibernate. It should be easy to add it into the runtime classpath of your application.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic