Hibernate / JPA: Unable to set field value using reflection device

My JPA / Hibernate Odyssey Continues ...

I am trying to get around this problem and therefore I had to define primitive @Ids in my class that uses 3 entity fields as a composite key. It seems to me a little more, but now I get it when I persist:

javax.persistence.PersistenceException: org.hibernate.PropertyAccessException: could not set a field value by reflection setter of com.example.model.LanguageSkill.stafferId

Here is my composite class:

public class LanguageSkill implements Serializable
{
    @Id
    @GeneratedValue (strategy = GenerationType.IDENTITY)
    @Column(name = "Staffer_ID")
    private Long stafferId;

    @Id
    @ManyToOne(cascade = CascadeType.ALL)
    @MapsId(value = "stafferId")
    private Staffer staffer;

    @Id
    @GeneratedValue (strategy = GenerationType.IDENTITY)
    @Column(name = "Language_ID")
    private Long languageId;

    @ManyToOne
    @MapsId(value= "languageId")
    private Language language;

    @Id
    @GeneratedValue (strategy = GenerationType.IDENTITY)
    @Column(name = "Language_Proficiency_ID")
    private Long languageProficiencyId;

    @ManyToOne
    @MapsId(value= "languageProficiencyId")
    private LanguageProficiency languageProficiency;
}

I have the correct getters and setters (generated by the IDE) for both primitives and entities.

Here are my libraries. I'm not quite sure that I am using a compatible set of persistence libraries (a reference to cooking, which details how to mix and match them correctly, would be highly appreciated.)

  • Hibernate 3.5.6-SNAPSHOT
  • hibernate-jpamodelgen 1.1.0.CR1
  • hibernate-validator 3.1.0.GA
  • MySQL 5.1.6
  • jsr250-api 1.0
  • javax.validation validation-api 1.0.0.GA

, . 3 , , ORM. .: - (

+5
2

. , Blob []

@Lob
@Column(name="DOCUMENTO",nullable=false)
private Blob[] documento;

Byte [], .

, Oracle, , LONG - ( - VARCHAR2).

, - Integer.... Long Integer? , .

, :

@Id
@SequenceGenerator(sequenceName="SQ_DOCUMENTO",name="seqDocumento")
@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="seqDocumento")
private Integer idDocumento;

Hibernate 3.5.6-final, Spring 3.0.4, Junit 4 Oracle 11g.

+1

@GeneratedValue.

-1

All Articles