• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

another Xdoclet question

 
Ranch Hand
Posts: 168
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all, I have another issue, I have defined a get method using xdoclet in my entity bean like this:

It�s a 0..1 relationship. Even when there is no object (0) it�s always returning something, which is not null but it�s not a valid object, since I cant call its methods.
When it�s 1 , no problem , it works fine...
Do you see something wrong in my definition above ?
Thanks in advance...
 
author
Posts: 422
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Without building your code myself, I can't be sure, but...
It looks to me that this is a simple 1-to-1 relationship where your EJB either has a related ItemTradeIn or it doesn't. Am I right?
If so, then it looks like there's an unnecessary target-multiple="yes" on @ejb.relation. I'm also thinking that the @ejb.value-object setup you have is unnecessary for a simple 1-to-1 relationship. Once you remove this stuff, it looks practically identical to some code that I have that I know works.
But again...without building and trying your code myself, I can't be certain what's up.
 
Giselle Dazzi
Ranch Hand
Posts: 168
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, I�ll work on it ...
 
reply
    Bookmark Topic Watch Topic
  • New Topic