grails - Bidirectional One-To-One -



grails - Bidirectional One-To-One -

i have 2 domain classes:

class contract { string refno } class attachment { byte[] info string mimetype string filename }

how can set relationships have both contractinstance.attachment , attachmentinstance.contract? think bidirectional one-to-one i'm not sure (one contract has have 1 attachment)...

class contract { attachment attachment } class attachment { static belongsto = [contract: contract] }

this define 1-to-1 relationship between two, contract beingness owner of relationship. means if save/delete contract save/delete cascade attachment, inverse not true.

grails

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -