• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Entity Bean 2.1 : Get column names

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Is it possible to get the column names and their data types in the entity bean class?
I need to get the list of column names programatically in the bean class. (Something similar to reflection API)

Thanks,
Anagha
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why? What are you trying to achieve?

The short answer is you can't (or at least can't easily).
 
anagha joshee
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've set up up the parent-child relationship bet'n Customer (CustID : Primary)
and Premise (LocID: Primary, CustID :Foreign)

I 've coded Finder method as
select * from premiseEntity as o, CustomerEntity c where o.addr1= ?1
This works well.

But if I replace where clause with o.CustID = ?1 (or any number type column in where clause) I get "AssertionError".

So I'll selectively call finder method for String type columns only.

Thats why I need to check the types of the columns @run time.

Thanks,
Anagha
 
I yam what I yam and that's all that I yam - the great philosopher Popeye. Tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic