hibernate - setting the hql or criteria for the below sql with decode condition in sql -
i have below following pojo , have generate hql or criteria following sql..
class took { private string aaa; private string bbb = ""; private string ccc; public took(string aaa, string bbb ,string ccc) { this.aaa = aaa; this.bbb = bbb; this.ccc = ccc; } } select aaa,decode(bbb_b,'y','act','rev') perm,ccc_c took
i have generated hql shown below , issue query shown in above sql query using decode on column bbb_b , setting value plus column perm created dynamically in query how adjust in hql please advise.
list<took> b1 = session.createquery("select new com.abc.def.took(aaa, bbb,ccc) took").list();
please advise crtiteria equivalent this
you can add annotation bbb property (if use annotations).
@formula("decode(bbb_b,'y','act','rev')") public string getbbb() { return bbb; }
Comments
Post a Comment