Patient.belongsTo(Doctor.class)
patient.belongsTo(doctor);
If I have Class Patient and Class Doctor, mapped via a many to many join table that has both IDs, I like the syntax where you can say:--
Patient.belongsTo(Doctor.class)
The problem is, most of the time I have just ONE of the classes and an ID. So rather than re-write a full on query pointing to the mapping table, it would be nice to be able to specify with one class and an ID for the other.
int iDoctorId = 20;
if (Patient.belongsTo (iDoctorId))doStuff();
I think is more common pattern of use and saves the redundent doctor lookup to get 2 objects. What do you suggest?
You received this message because you are subscribed to the Google Groups "ActiveJDBC Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to activejdbc-gro...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
This is pretty simple:
System.out.println(Patient.belongsTo(Doctor.class));//prints "true"