aspose file tools*
The moose likes Java in General and the fly likes Best way to join, display, edit two tables as one table Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Best way to join, display, edit two tables as one table" Watch "Best way to join, display, edit two tables as one table" New topic
Author

Best way to join, display, edit two tables as one table

Hugo Rabson
Greenhorn

Joined: Feb 01, 2008
Posts: 4
I am using the 'bind' feature of NetBeans 6.0 with a JTable (Swing) component to display and edit a Tools List. Every tool is also a 'part' (with its own serial# written on the part). If the Tools and Parts tables are joined (tools.part_id ---> parts.id), the resultant table lists the tools as well as each tool's serial#. It is possible to generate this table by calling an SQL query or a JPAQL query (the former as an inline function if you want).

The question is, what is the "best practice" way to:-
- generate the table (JPAQL createQuery(), SQL createNativeQuery(), inline SQL function...)
- bind the table (O/R mapping @OneToOne, @JoinColumn, JTable itself...)
- display/edit the table (JTable, custom editor component built on JTable, ...)

I know this is a complex question and I'm sorry for lumping it all together. I've been learning Java since August and I'm still getting stuck on this particular issue. Any insight would be appreciated, even simple pointers. Thank you for your time.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Best way to join, display, edit two tables as one table
 
Similar Threads
Syntax error in SQL
extract values
Mapping same POJO to two tables in Hibernate XML mapping files
Problems using GenerationType.IDENTITY for in-memory databases
jComboBox Renderer from two different entities (database tables)