-->
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: Stuck - Uniqueness on basis of the arbitrary properties.
PostPosted: Tue Dec 27, 2005 1:36 pm 
Newbie

Joined: Tue Dec 27, 2005 1:32 pm
Posts: 3
Uniqueness on basis of the arbitrary properties of my object model

My applicaiton has a very uniqure requirement :) (everyone thinks so)

I have my object model:

[code]
public class Person{
private String firstName = null;
private String lastName = null;
private Address address = null;
}
[/code]

My table is legacy. I want to ignore its PK constraints altogther - just to share with you guys we have a few coloums which make a composite key. I dont want to use all columns to define uniqueness.

Thus I want to make my own arbitraty properties to define uniquness. At least from my applications perspective.

I want that a combination of firstName and lastName to be checked for uniqueness before an insert takes place.

I tried to use the <composite-id> but it does not seem to do this. I really am stuck and really want hibernate to do this for me.

I am using Hibernate 3.1 - just to share with people who love hibernate did you notice all these crazy files in the download of hiberate 3.1. It has plethora of JBoss stuff. I think it is a matter of time we will see this lean mean machine hibernate become a elephant -- like IBM. Thanx for Gavin for a visit to Sun's team but his art for simplicity should remain. Unlike Sun where everything is like the JDO spec which was an obvious flop since its inception. Castor JDO was excellent but those guys just missed the whole thing because of it [b]intrusiveness[/b].

Only tools which are lean and mean and do the job with simplicity are the ones which will survive the this rat race of open source.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 27, 2005 2:49 pm 
Regular
Regular

Joined: Fri Sep 09, 2005 11:35 am
Posts: 101
hibernate does not do any data validation. you have to do it yourself.


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.