hi,
i am using hibernate annotation.but i got error as below during run time.
I have annotation.jar .which is latest.
Exception in thread "main" java.lang.NoSuchFieldError: sqlResultSetMappings
at org.hibernate.cfg.AnnotationConfiguration.createExtendedMappings(AnnotationConfiguration.java:166)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:254)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1036)
at First.main(First.java:37)
class for that is as below.
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EntityResult;
import javax.persistence.Id;
import javax.persistence.SqlResultSetMapping;
import javax.persistence.SqlResultSetMappings;
import javax.persistence.Table;
// default package
// Generated Feb 21, 2007 12:26:46 PM by Hibernate Tools 3.1.0.beta5
/**
* User generated by hbm2java
*/
@Entity
@Table(name = "user", catalog = "schema")
public class User implements java.io.Serializable {
// Fields
private int id;
private String username;
// Constructors
/** default constructor */
public User() {
}
/** minimal constructor */
public User(int id) {
this.id = id;
}
/** full constructor */
public User(int id, String username) {
this.id = id;
this.username = username;
}
// Property accessors
@Id
@Column(name = "id")
public int getId() {
return this.id;
}
public void setId(int id) {
this.id = id;
}
@Column(name = "username")
public String getUsername() {
return this.username;
}
public void setUsername(String username) {
this.username = username;
}
}
|