1 Reply Latest reply on Nov 21, 2008 10:10 AM by Wolfgang Knauf

    problem withonetoone mapping

    ravi krishna muthireddy Newbie


      I am having a problem with onetoone mapping .in my project i have mapped project--->buyerrating onetoone and project---->vendorrating onetoone. and this is my mappings code. please suggest me where i did mistake.

      this is project entity

      @Table(name = "PROJECT")
      public class Project implements Serializable{

      private int projectId;
      private BuyerRating buyerRating;
      private VendorRating vendorRating;
      @GeneratedValue( strategy=GenerationType.SEQUENCE, generator="projectid_sequence" )
      @SequenceGenerator( name="projectid_sequence", sequenceName="PROJECTID_SEQ" )
      @Column(name = "PROJECTID")
      public int getProjectId() {
      return projectId;
      public void setProjectId(int projectId) {
      this.projectId = projectId;
      public BuyerRating getBuyerRating() {
      return buyerRating;
      public void setBuyerRating(BuyerRating buyerRating) {
      this.buyerRating = buyerRating;

      public VendorRating getVendorRating() {
      return vendorRating;
      public void setVendorRating(VendorRating vendorRating) {
      this.vendorRating = vendorRating;

      this is vendorrating entity

      public class VendorRating implements Serializable{

      private int projectId;
      private Project project ;
      public Project getProject() {
      return project;
      public void setProject(Project project) {
      this.project = project;

      and exception is as follows

      at org.hibernate.cfg.OneToOneSecondPass.doSecondPass(OneToOneSecondPass.java:135)
      at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1130)
      at ....org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:296)
      at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1115)....................

      Thank you
      K ramu