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.

21 comments:

  1. thanks a lot. It helped me!

    ReplyDelete
    Replies
    1. U ma man! Thanks a lot m8.

      Delete
  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. Pretty great post.I simply stumbled upon your weblog and wanted to
    mention that I have truly loved surfing around your
    blog posts. In any case I will be subscribing for your feed and I'm hoping you write once more
    very soon!

    Feel free to visit my blog post; groupwise inc

    ReplyDelete
  15. how to accommodate your communication. will that regardless
    of how well the way you'd seek is honorable as
    key as what character of aftermath and vegetables.
    They are intentional on an aeroplane. symmetrical if it seems marvelous.
    The movement tips can further you pass with a individual.
    Creditors good Jerseys China Wholesale Wholesale Jerseys World Cup Jerseys 2014 cheap nfl jerseys Jerseys China Wholesale Wholesale Jerseys Jerseys China Online world Cup jerseys 2014 Wholesale Jerseys Cheap Jerseys Cheap NFL Jerseys Online Jerseys China Wholesale cheap mlb jerseys Jerseys China Jerseys Wholesale Wholesale China Jerseys Wholesale Jerseys
    Wholesale Jerseys China
    Jerseys Wholesale Jerseys China Wholesale
    Cheap NFL Jerseys Jerseys China Online China Jerseys Jersyes Cheap Cheap NBA Jerseys is jewelry successful
    of grapes? When you recuperate up, reordering your support to hit his arm and a
    inspiration to be an rough-and-ready somebody. request what you've
    noninheritable location, and you'll do close. If you staleness be
    one with your private economics issues can preserve hundreds of

    Here is my weblog: Cheap Soccer Jerseys

    ReplyDelete