These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Metadata: colum <-> property mapping
PostPosted: Mon Oct 15, 2007 12:34 pm 
Expert
Expert

Joined: Thu Jul 05, 2007 9:38 am
Posts: 287
Hi,
is there a away to determine the property of an entity class, that represents a given column in a table?

I found the metadata package, but Couldn't find a method to that effect and also the reference documentation doesn't help, neither does Google.

What I actually try to accomplish:
We have entities with multiy Column Unique keys defined via.

Code:
@UniqueConstraint(columnNames ...


Before saveOrUpdate I'd like to check if the unique key would be violated. (I am aware that I still might get UK violations due to race conditions).
Therefore I create Criterions to find matching recordsets in the database.

I now have the potential values, the properties they belong to and the columns that are constraint. But I am missing the relation between property names and columns.


Anybody an idea how to solve this problem?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 15, 2007 12:44 pm 
Expert
Expert

Joined: Tue Nov 23, 2004 7:00 pm
Posts: 570
Location: mostly Frankfurt Germany
Have a look into the source code of the schema generator.

_________________
Best Regards
Sebastian
---
Training for Hibernate and Java Persistence
Tutorials for Hibernate, Spring, EJB, JSF...
eBook: Hibernate 3 - DeveloperGuide
Paper book: Hibernate 3 - Das Praxisbuch
http://www.laliluna.de


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.