persistence - Query entity class with multiple joins using criteria api -
how select rows in table using docid column value , retrieve values in appointment table values in patient table. query should in criteria api. entity class follows 2 joins.
@entity @table(name="appointment") public class appintment implements serializable { private static final long serialversionuid = 1l; @id @column(unique=true, nullable=false, length=20) private string appid; @temporal(temporaltype.date) @column(name="app_date", nullable=false) private date appdate; //bi-directional many-to-one association doctors @manytoone @joincolumn(name="docid", nullable=false) private doctor doctor; //bi-directional many-to-one association patients @manytoone @joincolumn(name="userid", nullable=false) private patient patient; }
Comments
Post a Comment