Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to know whether a particular row exists in table

 
chandrakanth boga
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a Table USTCOLOR which has two colomns project_reference and Color_Codes.

How do i find a particular project reference exists in the table or not?
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you using an ORM for this? If so, which one?
 
chandrakanth boga
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes...I am using Hibernate
 
chandrakanth boga
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using Oracle database
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well you can get it by its primary key or look it up via a query. See the Session interface and its various get and createQuery methods.
 
chandrakanth boga
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for the information paul.....But i am completely new with the Hibernate...I really some code stuff...
 
Darya Akbari
Ranch Hand
Posts: 1855
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

if you are new to Hibernate take look at Java Persistence with Hibernate - Chapter 2 for a deeper understanding. There search for createQuery.

Regards,
Darya
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic