• 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

need help with xdoclet generated method

 
Ranch Hand
Posts: 168
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Good evening everyone,
I have a method generated by

this method will return only a null value, always, here is my table:

I have null values and numeric values in it, but I only get null as a return of this method.
This table has a relationship with the table

Would anybody have any idea why this method only returns null to me ?
Thanks in advance,
[ December 09, 2003: Message edited by: Giselle Dazzi ]
 
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
I got this one...
 
Ranch Hand
Posts: 1646
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Giselle Dazzi:
I got this one...


Could you please briefly post the solution so that when someone finds your post while searching for a solution to the same problem they'll find it.
 
author
Posts: 422
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by David Harkness:

Could you please briefly post the solution so that when someone finds your post while searching for a solution to the same problem they'll find it.


It looks like getIdItemTradeIn() was returning an Integer instead of an ItemTradeIn.
 
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
Hi, Yeah, I should have done that , sorry.
What happens is that we are using the Value objects Design Patterns. They are created using reflection from the entity beans ( hope I got this right ) .
Anyway, I didnt have a set method for this field in my entity, It looks like the person that first wrote this code thought we would do it thru a method in another bean...
Anyway, you cant tell Im not really solid in my concepts yet, but it worked ! :-)
 
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Giselle Dazzi:
I didnt have a set method for this field in my entity, It looks like the person that first wrote this code thought we would do it thru a method in another bean...


I was dazzled to see this discussion of why the table was not generated with NOT NULL. If I understand you correctly, the simple presence or absence of a "public Integer setIdItemTradeIn() {... " tells XDoclet whether to allow NULLs. On the face of it, this seems wierd and subtle.
 
Author
Posts: 367
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think it's probably the lack of context that is confusing you. It might make more sense with a full bean. It sounds to me like it was his reflection code which wasn't finding the method and thus not populating the bean from the VO.
Also, note that XDoclet doesn't create the NOT NULL constraint or any other relational schema. XDoclet creates the deployment descriptors which, depending on your appserver, may be used to generate the schema for you.
That's not to say that XDoclet doesn't have strange and quirky behaviours.
 
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
One thing Im sure of is that I need to work on my concepts, EJB, Xdoclets and Design Patterns.
This project also uses the framework Cocoon, just to add one more thing for me to look at...
I was chosen for this project because im SCJP, but there is a long way between J2SE and J2EE.
So, given all this, do you think your book would help people in my situation ?
 
this is supposed to be a surprise, but it smells like a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic