File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes problem while displaying foreign key data when integrating struts and hibernate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "problem while displaying foreign key data when integrating struts and hibernate" Watch "problem while displaying foreign key data when integrating struts and hibernate" New topic
Author

problem while displaying foreign key data when integrating struts and hibernate

Rosu Thomas
Greenhorn

Joined: Jun 19, 2012
Posts: 17
hi,

i am using struts2 integrated with hibernate.i have an itemmaster class with itemuom attribute as foriegn key from UOM master class.
here is my classes.



ITEMMASTER CLASS

UOM

JSP page



ACTION class


controller class


i want to display all the fields of itemmaster in JSP page.....but i am able to display all the fields except item_UOM which is foreign key from UOM .also please note that item_UOM is a join cloumn(no getters and setters in itemmaster)
please give me a solution ASAP
Rosu Thomas
Greenhorn

Joined: Jun 19, 2012
Posts: 17
please reply ASAp................................................i need to get the value of my join column(item_UOM). when im using getU() im getting an object as org.Model.UOM@155994c......im not able to convert that into String..........please help me.................................................................thanks in advance
Rosu Thomas
Greenhorn

Joined: Jun 19, 2012
Posts: 17
Somebody Please help me......................
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8964
    
    9

I added Code Tags to your post. That will make it easier to read. Please be patient. We are all volunteers here. In the mean time, you may want to break your problem up into smaller pieces, like a piece of code that retrieves a single record from the database.


[How To Ask Questions On JavaRanch]
Rosu Thomas
Greenhorn

Joined: Jun 19, 2012
Posts: 17
Rosu Thomas wrote:hi,
here is the modified code as you suggested.......thanks for your reply.....................

i am using struts2 integrated with hibernate.i have an itemmaster class with itemuom attribute as foriegn key from UOM master class.
here is my classes.



ITEMMASTER CLASS

UOM

JSP page



ACTION class


controller class


i want to display all the fields of itemmaster in JSP page.....but i am able to display all the fields except item_UOM which is foreign key from UOM .also please note that item_UOM is a join cloumn(no getters and setters in itemmaster)
please give me a solution ASAP
Rosu Thomas
Greenhorn

Joined: Jun 19, 2012
Posts: 17
hi.................
i got solution..............
<s:div cssClass="mrc_trdt"><s:property value="u.unit_of_measure"/></s:div>
just call attribute of UOM class using instance of UOM in itemmaster class...................
hope you understood what i meant...........
thanks a lot for helping me.....see you soon..
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem while displaying foreign key data when integrating struts and hibernate