Back to project page android-mvc-framework.
The source code is released under:
Apache License
If you think the Android project android-mvc-framework listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.android_mvc.framework.db.dao; /* ww w .j a va 2s .co m*/ import java.util.ArrayList; import com.android_mvc.framework.common.FWUtil; import com.android_mvc.framework.db.DBHelper; import com.android_mvc.framework.db.entity.BaseLogicalEntity; /** * DAO????????? * @author id:language_and_engineering */ public class BaseDAO<T extends BaseLogicalEntity<T>> { /** * ????????????????????????? */ public ArrayList<T> findAll(DBHelper helper, Class<T> entity_class) { // ??????????????????????? return new Finder<T>(helper) .where("id > 0") .orderBy("id DESC") .findAll(entity_class) ; } /** * ??????????????????????? */ public T findById(DBHelper helper, Class<T> entity_class, Long record_id) { // ?????ID?????????? ArrayList<T> result = new Finder<T>(helper) .where("id = " + record_id.toString()) .findAll(entity_class) ; if( result.size() > 0 ) { return result.get(0); } else { FWUtil.w("???????????????????????????????id = " + record_id.toString()); return null; } } }