-->
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.  [ 1 post ] 
Author Message
 Post subject: hbm2java sql function in constraint
PostPosted: Thu Sep 18, 2014 3:48 am 
Newbie

Joined: Thu Sep 18, 2014 3:32 am
Posts: 1
Hi,
We have currently an issue regarding the code generated by the hibernate tool. We are using Postgres and there is a requirement that a column may contain a textual value in case sensitive format but the value itself has to be unique when converted to upper case. The problem appears on the following line when we create the mapping code:
Code:
uniqueConstraints=@UniqueConstraint(columnNames={"webbrok_user", "upper((webbro)::text)"}),

When the application is started, there is an error message:
Code:
org.hibernate.AnnotationException: Unable to create unique key constraint (webbro, upper((webbro)::text)) on table webbroker: database column 'upper((webbro)::text)' not found. Make sure that you use the correct column name which depends on the naming strategy in use (it may not be the same as the property name in the entity, especially for relational types)

Obviously the problem is the sql function "upper" as hibernate handles it as a column name. What could be the solution for this kind of problem? Should we create a custom mapping generator or is there some other way to solve this problem?


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

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.