we have two databases currently build with hibernate using the “org.hibernate.dialect.PostgreSQLDialect” dialect, i.e. UsersDB and AttachmentsDB.
The question is: Is it possible to have a foreign key constrain in UsersDB referencing an UUID field in AttachmentsDB. If yes how should the @JoinColumn annotation look like? Or is it done in a different way?
Something like that:
@OneToMany(cascade=CascadeType.ALL) @JoinColumn(name="ATTACHMENT_ID", database=”AttachmentsDB”) @ElementCollection(fetch=FetchType.EAGER) private Collection<Attachments> attachment;
regards,
K
|