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
Post a Comment