[jboss-user] [JBoss Seam] - Hibernate : insertion in DataBase with java code.

nemya do-not-reply at jboss.com
Wed Aug 29 11:07:50 EDT 2007


Hi,
I'm using Jboss Seam 1.2.1.GA + Jboss Server 4.0.5.GA. I'm trying to add rows in the DataBase, using hibernate, with the code. I tryed this :

ChargeCollaborateuraffecteHome chargeCollaborateuraffecteHome = new ChargeCollaborateuraffecteHome();
  | ChargeCollaborateurAffecte chargeCollaborateurAffecte =  chargeCollaborateuraffecteHome.createInstance();
  | 				
  | chargeCollaborateurAffecte.setChargeEffective(charge);
  | chargeCollaborateurAffecte.setChargePrevisionnelle(0);
  | chargeCollaborateurAffecte.setCollaborateurAffecte(this);
  | chargeCollaborateurAffecte.setDate(dateCharge);
  | 				chargeCollaborateuraffecteHome.setInstance(chargeCollaborateurAffecte);
  | 				
  | chargeCollaborateuraffecteHome.persist();

But I have an exception caused by the persist()   (line 208): 
Caused by: java.lang.NullPointerException
  | 	at org.jboss.seam.framework.Home.updatedMessage(Home.java:40)
  | 	at org.jboss.seam.framework.EntityHome.update(EntityHome.java:40)
  | 	at com.fitnetapplication.resources.model.CollaborateurAffecte.setChargeEffective(CollaborateurAffecte.java:208)
  | 	at crossTable.action.activitesByCollaborateurCrossDataBean.sauvgarderCrossDataTable(activitesByCollaborateurCrossDataBean.java:150)
  | 	at crossTable.action.activitesByCollaborateurCrossDataBean.chercherActivites(activitesByCollaborateurCrossDataBean.java:125)
  | 

Please help a Newbie!

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4079220#4079220

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4079220



More information about the jboss-user mailing list