aspose file tools*
The moose likes Object Relational Mapping and the fly likes is it good idea to create domain classes for temporary tables, if so, is how is possible Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "is it good idea to create domain classes for temporary tables, if so, is how is possible" Watch "is it good idea to create domain classes for temporary tables, if so, is how is possible" New topic
Author

is it good idea to create domain classes for temporary tables, if so, is how is possible

rama kammari
Greenhorn

Joined: Jun 14, 2012
Posts: 9
I have a stored procedure in sql server , my goal is i need to parse that into java code , In procedure there are some physical and temporary tables involved , i created domain classes for physical tables, so can i also map domain classes with temporary table .
my procedure is

James Sutherland
Ranch Hand

Joined: Oct 01, 2007
Posts: 553
You could create a class to represent the stored procedure result set. You would just need to map the class to the field names that the procedure returns (or use a result set mapping).

It would be a read-only entity. You could set the table name to just some dummy table name, or let it default.

You could also just execute the stored procedure without a result class. You would get an Object[] back, which you could then pass to a constructor for your class and assign the field values directly.

TopLink : EclipseLink : Book:Java Persistence : Blog:Java Persistence Performance
rama kammari
Greenhorn

Joined: Jun 14, 2012
Posts: 9
thank you , i created one class that represents the result set of procedure, and i mapped properties of that class with procedure return results,
and i have list of files that represent #files (temporary table) , even though i have one more problem is that, there is a #files (temporary table) in the FROM Clause of Select Statement.
So How can i map this Files class with #files temporary table, is it possible to map? (because it is not physical table in database), so how can i achieve this using Java Code?
( or) please give me suggestions, How to write the java code(in spring jdbc) using domain(pojo) classes by mapping with physical and temporary tables for the above mentioned 'select query ' .
 
Don't get me started about those stupid light bulbs.
 
subject: is it good idea to create domain classes for temporary tables, if so, is how is possible