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?