How to check if entiti to save exists in database?

pit's Avatar

pit

12 Mar, 2010 09:15 AM via web

Hi,

according to your example with Store, Product and Employee I have a question. How can I chceck if entity Store with name for example "TestStore" exists in table Store before saving or updating session?

  1. Support Staff 2 Posted by James Gregory on 12 Mar, 2010 09:19 AM

    James Gregory's Avatar

    You'll need to query for it. Have a read up on the criteria API or HQL.

  2. James Gregory closed this discussion on 18 Mar, 2010 12:20 PM.

Comments are currently closed for this discussion. You can start a new one.