Public List Searchbyparas (string authId, String resourceId, Integer state, integer value, string description) {LOG.D
Ebug ("Finding Kiiuaresauth instance by example");
try {description = Description.replace ("//", "//////"). Replace ("%", "//%"). Replace ("'", "" ");
StringBuffer hql = new StringBuffer ("from Kiiuaresauth as K joins K.id.resource as R where k.description like '%"
+ description + "% '");
if (authId! = "") {Hql.append ("and k.id.authid= '" + authId + "'");
} if (ResourceId! = "") {Hql.append ("and r.resourceid= '" + resourceId + "'");
if (state! = null) {Hql.append ("and k.resauthstate=" + state);
} if (value! = null) {Hql.append ("and k.value=" + value);
} if (Description.indexof ("//") >= 0) {hql.append ("Escape"/");
List results = gethibernatetemplate (). Find (Hql.tostring ());
Log.debug ("Find by example successful, result size:" + results.size ()); List Toresult = new ArrayList ();
object[] objlist = null;
if (results.size ()! = 0) {for (int i = 0; i < results.size (); i++) {Object Objs = Results.get (i);
Objlist = (object[]) Objs;
if (objlist[0]! = null) {Toresult.add ((Kiiuaresauth) objlist[0]);
}}} return toresult;
} catch (RuntimeException re) {Log.error ("Find by Example failed", re);
throw new SystemException ("UA1202"); }
}