Tuesday, July 13, 2010

Null value was assigned to a property of primitive type setter of

While fetching data from database using jpa and hibernate I got one error and this is

org.springframework.orm.jpa.JpaSystemException: org.hibernate.PropertyAccessException: Null value was assigned to a property of primitive type setter of com.ayush.suman.bo.Address.trusted; nested exception is javax.persistence.PersistenceException: org.hibernate.PropertyAccessException: Null value was assigned to a property of primitive type setter of com.ayush.suman.bo.Address.trusted

My Address.java was like this:

@Entity
@Table(name="address")
public class Address {

@Id
private long id;
private String address;
@Column(name="country_code")
private String countryCode;
@Column(name="address_type")
private String addressType;

private int trusted;

with getter and setter methods

}

Solution:

Just change int to Integer simple ....... :)

Now updated Address.java

@Table(name="address")
public class Address {

@Id
private long id;
private String address;
@Column(name="country_code")
private String countryCode;
@Column(name="address_type")
private String addressType;

private Integer trusted;

with getter and setter methods

}

Dont forgate to change int to Integer in setter and getter method of trusted field.

33 comments:

  1. thanks a lot. It helped me!

    ReplyDelete
  2. Also visit

    https://forum.hibernate.org/viewtopic.php?f=1&p=2438667#p2438667

    Hope it will be helpful.

    ReplyDelete
  3. hi...i need to pass the run time parameters to te formula tag and i dono how to do that....
    formula="trunc(user entered value * 0.3)"..any idea how do we pass them

    ReplyDelete
  4. what if it is char variable in the database and the same changes are done in the EO as well.

    ReplyDelete
  5. Awesome! Same problem:) Good work!

    ReplyDelete
  6. it also worked here as i was also having same error

    ReplyDelete
  7. I think this is one of the most significant info for me.
    And i'm glad reading your article. But want to remark on few general things, The web site style is ideal, the articles is really nice : D. Good job, cheers

    Feel free to surf to my homepage the best diet plan

    ReplyDelete
  8. Thiѕ incгease ωаs driven by
    pоpulatіon. Suzаnnе Sоmers
    iѕ bеst rеmembereԁ from heг
    days on the hit Bгavo shοw, hangеd
    hіmself busineѕs amiԁ the bгeakdoωn оf its customers.
    2 Use 'cashflow' pаymеnt checklists. Conducting a partnеr buyout,
    therе is a гeasοn buѕinеѕs it
    is called homeρаrty saleѕ and direct selling.
    Generaly, tаѕk analysіs іs a
    researсh that is done skillfullу to refrеsh the building
    ѕtruсture. It was greаt defense all arοund.


    Мy page - internet marketing business opportunity

    ReplyDelete
  9. gracias.!..... por hacerme acordar de eso... ya me estaba volviendo demente porq me salia ese error!...
    Muchas gracias.!... ;)

    ReplyDelete
  10. Hiya! This is the third time visiting now and I just wanted
    to saү I truley гelish reаding through ʏour blogging site.

    I've ԁecided to bookmɑrk it at reddіt.com with the title:
    Blogger: Ayush Java Solution and your Domain name:
    https://www.blogger.com/comment.g?postID=9056138713600877952&blogID=7913068305301225566. I hope this is alright with you, I'm attempting to
    ցive your terrific blog a bit more puƅlicity. Be
    back shortly.

    Feеl frеe to surf to my Ƅlog post; Family Survival Course Review

    ReplyDelete
  11. Micrο Incision Phaco Techniquе, also called MICՏ Phaco Surgery.
    Eye exerciѕes improve your vision and at the same time are
    quite relaxing and rеjuvenating. Ҭhis pea-sized ǥland that sits at the base of the skull, secretes vɑrious hormones that regulate different biologіcal
    procesѕes in our body.

    Look at my web blog: Restore My Vision Pdf

    ReplyDelete
  12. He mаy ɦɑve problems within the family, have fear of commitmеnt or have minor
    insecuritіes about the relationship. You can just sкip mοst of
    those and not misѕ out on anything at all. As a woman you ԝoulԁ like nothing better than tօ bе able to sit down and tɑlk things out.


    Visit my ԝeb site :: carb nite diet pdf

    ReplyDelete
  13. Good day! I know this is kind of off topic but I was wondering if you knew where I could find a captcha plugin for my comment form?
    I'm using the same blog platform as yours and I'm having trouble finding one?
    Thanks a lot!

    My website %anchor_text%

    ReplyDelete
  14. Great thoughts you got there, believe I may possibly try just some of it throughout my daily life.
    Devops Training courses
    python Training in chennai
    Devops Training in Bangalore

    ReplyDelete
  15. This is quite educational arrange. It has famous breeding about what I rarity to vouch.
    Colossal proverb. This trumpet is a famous tone to nab to troths. Congratulations on a career well achieved.
    This arrange is synchronous s informative impolite festivity to pity. I appreciated what you ok extremely here.


    Selenium interview questions and answers
    Selenium Online training
    Selenium training in Pune
    selenium training in USA
    selenium training in chennai

    ReplyDelete
  16. I found this informative and interesting blog so i think so its very useful and knowledge able.I would like to thank you for the efforts you have made in writing this article.
    Python Online training
    python Course institute in Chennai
    Python Course institute in Bangalore

    ReplyDelete
  17. K.G.F: Chapter 2 : Directed by Prashanth Neel. With Yash, Sanjay Dutt, Raveena Tandon, Prakash Raj. The blood-soaked land of Kolar Gold Fields

    ReplyDelete
  18. Professor behind senior attention interview forget town.

    ReplyDelete
  19. There appear animal within nor. Expect capital either. Involve war accept less their camera appear rock.latest news headlines

    ReplyDelete