Re: Relation null??

From: Mike Kienenberger (mkienen..laska.net)
Date: Wed Jun 29 2005 - 11:52:02 EDT

  • Next message: Dhruti Ramani: "Many to Many Relation"

    Emre Yilmaz <emre.yilma..tr.com.tr> wrote:
    > I want to set a table relation to null but I couldn't do this i get an
    > Exception of nullpointer. How can I set a table relation null or like
    null.
    > My code is here;
    >
    > Visitor visitor = getPersonel(identNo);
    > Visitor visitor2 = getPersonelByCardNo(cardNo);
    > if(visitor2==visitor){
    > visitor2.setCardRel(null);
    > }else if(visitor2!=null){
    > visitor2.setCardRel(null);
    > }else if(visitor!=null){
    > visitor.setCardRel(null);
    > }
    >
    > java.lang.NullPointerException

    What's the next line of the stack trace?

    The problem isn't setting the relationship null -- it's probably that
    visitor or visitor2 is null, and you're trying to perform a method on a null
    object.

    -Mike



    This archive was generated by hypermail 2.0.0 : Wed Jun 29 2005 - 11:49:10 EDT