-->
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.  [ 2 posts ] 
Author Message
 Post subject: Help with annotation
PostPosted: Mon Feb 08, 2010 3:02 pm 
Newbie

Joined: Wed Oct 14, 2009 3:22 pm
Posts: 16
Hi,

I'm using Hibernate 3.3.2.GA with an Oracle 10g database. In my Oracle table, "USER_LOGINS", I have a column, SUBVENDOR_ID, that can be NULL, but if it contains a number, that would link to the primary key of another table, named "SUBVENDOR".

However, right now the Subvendor object is not getting loaded into my UserLogin model. I suspect my annotation can be off. Can you provide some suggestions to make it work? Below is my Java code, - Dave

Code:

  @ManyToOne
  @JoinColumn(name = "subvendor_id")
  private Subvendor subvendor;

  ...

  /**
   * Getter for property <code>subvendor</code>.
   *
   * @return Value of property <code>subvendor</code>.
   */
  public Subvendor getSubvendor() {
    return subvendor;
  }

  /**
   * Setter for property <code>subvendor</code>.
   *
   * @param subvendor New value of property <code>subvendor</code>.
   */
  public void setSubvendor(Subvendor subvendor) {
     LOGGER.debug("setting subvendor:" + subvendor);
     this.subvendor = subvendor;
  }


Top
 Profile  
 
 Post subject: Re: Help with annotation
PostPosted: Wed Feb 10, 2010 8:51 am 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
Could you possible post a bit more of the mappings?

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


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

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.