• Post Reply Bookmark Topic Watch Topic
  • New Topic

Entity Bean 2.1 : Get column names

 
anagha joshee
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • 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
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!