Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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: 8836
    
    7

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.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[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
 
Similar Threads
hibernate views
Path Value in input type in jsp page using Spring MVC
javac : Compiling a .JAVA file which uses other classes in it
Row Selection problems with JTable
Having problems with an arrays assignment