This content has been marked as final.
Show 2 replies
-
1. Re: How to add uniqueConstraint on two columns together
gonorrhea May 7, 2009 6:51 PM (in response to cash1981)If you know how to write the DDL in T-SQL or PL/SQL, etc. you should do that to mod the table definition and then reverse engineer the table.
Here is an example with MSSQL:
ALTER TABLE [dbo].[ApplicationSettingValue] ADD CONSTRAINT [UK_APPLICATIONSETTINGVALUE_SETTINGID_SITEID] UNIQUE NONCLUSTERED ( [SettingID] ASC, [SiteID] ASC )
Entity @Table(name = "ApplicationSettingValue", uniqueConstraints = @UniqueConstraint(columnNames = { "SettingID", "SiteID"})) public class ApplicationSettingValue implements java.io.Serializable { ... }
-
2. Re: How to add uniqueConstraint on two columns together
cash1981 May 7, 2009 9:19 PM (in response to cash1981)Thanks, I will try your solution although what I still wonder about is what should be the columnName for the ManyToOne.
The table says organization_id. My guess thats the correct one to use.