This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes How to select column names using JP QL or however possible Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Reply Bookmark "How to select column names using JP QL or however possible" Watch "How to select column names using JP QL or however possible" New topic
Author

How to select column names using JP QL or however possible

Bonno Mosimanyana
Greenhorn

Joined: Sep 29, 2010
Posts: 1
Hi all,

I have a problem am still learning Spring MVC and JPA. I can't figure out how to select column names using either EntityManager or JP QL.
What I want is to get the column names of a table and pass them to my success view so that I can display them in a table format as headings. I want for this functionality to
be generic if possible.I'm using Spring MVC and JPA with TopLink Essentials as the persistence provider. Here's some of my code in the onSubmit() method:

Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17234
    
    1

This is a JPA question, so moving this to the ORM forum.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Column names? Are the property names of your object not more appropriate? Why do you want to map a relational model to and object model if you are displaying the relational model?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: How to select column names using JP QL or however possible
 
Similar Threads
JPA impl. w/Hibernate & Oracle PK Sequences/Triggers
JP QL for selecting specific entities in a relationship
Spring 101: DB Table to return a Map of Code,Description.
Hibernate problem
Getting column names from the table name