Hi All,
if I create join table like this:
@OneToMany
@ LazyCollection ( LazyCollectionOption.FALSE )
@JoinTable(
name="authorities",
joinColumns = { @JoinColumn( name="user_id") },
inverseJoinColumns = @JoinColumn( name="role_id")
)
there is a unique constraint on role_id . what should I use if I need role_id in join table without any constraints?
thanks.
PS
inverseJoinColumns = @JoinColumn( name="role_id",unique=false)
didn't help.
tabel created like:
CREATE TABLE authorities
(
user_id int8 NOT NULL,
role_id int8 NOT NULL,
CONSTRAINT authorities_pkey PRIMARY KEY (user_id, role_id),
CONSTRAINT fk2b0f1321a4363147 FOREIGN KEY (user_id)
REFERENCES users (id) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT fk2b0f1321ff0b6d67 FOREIGN KEY (role_id)
REFERENCES authority (id) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT authorities_role_id_key UNIQUE (role_id)
)
is there any way to get rid of this
CONSTRAINT authorities_role_id_key UNIQUE (role_id) ?
|