| 
					
						 Hi!
 
 I'm really not sure how to map my id property in my class, since this id is generated in the db by a trigger. I've read the documentation and i had the impression that what i should do was:
 
 class Users {
 
  ...
 
  @Id
     @Generated(GenerationTime.ALWAYS)
     @Column(name="COD_USER", nullable=false,insertable = false, updatable = false)
     public Long getCodUser() {
         return codUsuario;
     }
 ...
 }
 
 or
 
 class Users {
 
  ...
 
  @Id
     @Generated(GenerationTime.INSERT)
     @Column(name="COD_USER", nullable=false,insertable = false, updatable = false)
     public Long getCodUser() {
         return codUsuario;
     }
 ...
 } 
 
 But both of them get me this exception:
 
 exception
 
 javax.servlet.ServletException
 	javax.faces.webapp.FacesServlet.service(FacesServlet.java:209)
 
 root cause
 
 java.lang.NullPointerException
 	org.hibernate.cfg.annotations.PropertyBinder.make(PropertyBinder.java:145)
 	org.hibernate.cfg.AnnotationBinder.bindId(AnnotationBinder.java:1729)
 	org.hibernate.cfg.AnnotationBinder.processElementAnnotations(AnnotationBinder.java:1171)
 	org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:706)
 	org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:452)
 	org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:268)
 	org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1210)
 
 
 How am I supposed to map this?
 Please i really need some help!
 Thanks!
 =) 
											 _________________ jaq
					
  
						
					 |