-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: org.hibernate.PropertyAccessException: IllegalArgumentExcept
PostPosted: Fri May 11, 2012 10:56 am 
Newbie

Joined: Fri May 11, 2012 10:49 am
Posts: 3
I am getting following exception while updating employee object

org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of com.orbitbenefits.model.core.EmployeePartner.id

NOTE: I am doing one to one mapping based on common primary key

Can anyone help please?

Sample Code:

Code:
SuppressWarnings("JpaDataSourceORMInspection")
@Entity
@Table(name = "employee")
@Cacheable
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
@UniqueUsername(groups = AllChecks.class)
public class Employee extends Person {

   private Person partner;

   @Id
    @Column(name = "employee_id")
    @Override
    public Long getId() {
        return super.getId();
    }

@OneToOne(targetEntity = EmployeePartner.class, cascade = CascadeType.ALL, fetch = FetchType.EAGER, orphanRemoval = true)
    @JoinColumn(name = "employee_id")
    public Person getPartner(){
        return partner
    }






@Entity
@Table(name = "employee_partner")
public class EmployeePartner extends Person {

    @Id
    @Column(name = "employee_id")
    @Override
    public Long getId() {
        return super.getId();
    }

    @Column(name = "surname", nullable = false)
    @Override
    public String getSurname() {
        return super.getSurname();
    }

    @Column(name = "firstname")
    @Override
    public String getFirstname() {
        return super.getFirstname();
    }

    @Column(name = "middle_initials")
    @Override
    public String getMiddleInitials() {
        return super.getMiddleInitials();
    }

    @Column(name = "title")
    @Override
    public String getTitle() {
        return super.getTitle();
    }

    @Column(name = "date_of_birth", nullable = false)
    @Override
    public Date getDateOfBirth() {
        return super.getDateOfBirth();
    }

    @Type(type = "com.orbitbenefits.util.hibernate.GenderType")
    @Column(name = "gender", nullable = false)
    @Override
    public Gender getGender() {
        return super.getGender();
    }

    @Column(name = "relationship_code", nullable = false)
    public String getRelationshipCode() {
        return super.getRelationship().getCode();
    }
}


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.