If I want to use a domain class, for example. MoneyTransaction for two completely different purposes, that is:
1) when the customer places an order
2) when the participant receives payment
so i have something like:
class Order { static hasMany = [transactions: MoneyTransaction] } class Member { static hasMany = [payments: MoneyTransaction] }
and
class MoneyTransaction { static belongsTo = [order: Order, member: Member] static constraints = { order(nullable: true) member(nullable: true) } }
and then, essentially, only use one name belongs / association at a time, is this a pretty "standard" use, or do I need to switch this simulation? Currently MoneyTransaction has both credit cards and ACH payment options, as they are used for orders. Only part of the ACH will be used for payments.
source share