// Path: app/src/main/java/com/leelit/stuer/bean/TreeholeLocalInfo.java
// public class TreeholeLocalInfo extends TreeholeInfo {
// 
//     boolean like;
// 
//     boolean unlike;
// 
//     public boolean isLike() {
//         return like;
//     }
// 
//     public void setLike(boolean like) {
//         this.like = like;
//     }
// 
//     public boolean isUnlike() {
//         return unlike;
//     }
// 
//     public void setUnlike(boolean unlike) {
//         this.unlike = unlike;
//     }
// 
//     @Override
//     public String toString() {
//         return "TreeholeLocalInfo{" +
//                 "datetime='" + datetime + '\'' +
//                 ", state='" + state + '\'' +
//                 ", picAddress='" + picAddress + '\'' +
//                 ", uniquecode='" + uniquecode + '\'' +
//                 ", like=" + like +
//                 ", unlike=" + unlike +
//                 "} ";
//     }
// }
// 
// Path: app/src/main/java/com/leelit/stuer/bean/TreeholeInfo.java
// public class TreeholeInfo {
//     String datetime;
// 
//     String state;
// 
//     String picAddress;
// 
//     String uniquecode;
// 
//     @Override
//     public String toString() {
//         return "TreeholeInfo{" +
//                 "datetime='" + datetime + '\'' +
//                 ", state='" + state + '\'' +
//                 ", picAddress='" + picAddress + '\'' +
//                 ", uniquecode='" + uniquecode + '\'' +
//                 '}';
//     }
// 
//     public String getDatetime() {
//         return datetime;
//     }
// 
//     public void setDatetime(String datetime) {
//         this.datetime = datetime;
//     }
// 
//     public String getState() {
//         return state;
//     }
// 
//     public void setState(String state) {
//         this.state = state;
//     }
// 
//     public String getPicAddress() {
//         return picAddress;
//     }
// 
//     public void setPicAddress(String picAddress) {
//         this.picAddress = picAddress;
//     }
// 
//     public String getUniquecode() {
//         return uniquecode;
//     }
// 
//     public void setUniquecode(String uniquecode) {
//         this.uniquecode = uniquecode;
//     }
// }


import android.content.ContentValues;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import com.leelit.stuer.bean.TreeholeLocalInfo;
import com.leelit.stuer.bean.TreeholeInfo;
import java.util.ArrayList;
import java.util.List;
            } while (cursor.moveToNext());
        }
        cursor.close();
        db.setTransactionSuccessful();
        db.endTransaction();
        return result;
    }

    public static TreeholeLocalInfo getComment(String uniquecode) {
        SQLiteDatabase db = DatabaseHelper.getInstance().getReadableDatabase();
        Cursor cursor = db.query("treehole", null, "uniquecode = ?", new String[]{uniquecode}, null, null, null);
        TreeholeLocalInfo comment = new TreeholeLocalInfo();
        cursor.moveToFirst();
        comment.setDatetime(cursor.getString(cursor.getColumnIndex(keys[0])));
        comment.setState(cursor.getString(cursor.getColumnIndex(keys[1])));
        comment.setPicAddress(cursor.getString(cursor.getColumnIndex(keys[2])));
        comment.setUniquecode(cursor.getString(cursor.getColumnIndex(keys[3])));
        comment.setLike(TRUE == cursor.getInt(cursor.getColumnIndex(keys[4])));
        comment.setUnlike(TRUE == cursor.getInt(cursor.getColumnIndex(keys[5])));
        cursor.close();
        return comment;
    }

    public static void updateLikeOfComment(String uniquecode, int isLike) {
        SQLiteDatabase db = DatabaseHelper.getInstance().getWritableDatabase();
        ContentValues values = new ContentValues();
        values.put(keys[4], isLike);
        db.update("treehole", values, "uniquecode = ?", new String[]{uniquecode});
    }

// Path: app/src/main/java/com/leelit/stuer/bean/TreeholeLocalInfo.java
// public class TreeholeLocalInfo extends TreeholeInfo {
// 
//     boolean like;
// 
//     boolean unlike;
// 
//     public boolean isLike() {
//         return like;
//     }
// 
//     public void setLike(boolean like) {
//         this.like = like;
//     }
// 
//     public boolean isUnlike() {
//         return unlike;
//     }
// 
//     public void setUnlike(boolean unlike) {
//         this.unlike = unlike;
//     }
// 
//     @Override
//     public String toString() {
//         return "TreeholeLocalInfo{" +
//                 "datetime='" + datetime + '\'' +
//                 ", state='" + state + '\'' +
//                 ", picAddress='" + picAddress + '\'' +
//                 ", uniquecode='" + uniquecode + '\'' +
//                 ", like=" + like +
//                 ", unlike=" + unlike +
//                 "} ";
//     }
// }
// 
// Path: app/src/main/java/com/leelit/stuer/bean/TreeholeInfo.java
// public class TreeholeInfo {
//     String datetime;
// 
//     String state;
// 
//     String picAddress;
// 
//     String uniquecode;
// 
//     @Override
//     public String toString() {
//         return "TreeholeInfo{" +
//                 "datetime='" + datetime + '\'' +
//                 ", state='" + state + '\'' +
//                 ", picAddress='" + picAddress + '\'' +
//                 ", uniquecode='" + uniquecode + '\'' +
//                 '}';
//     }
// 
//     public String getDatetime() {
//         return datetime;
//     }
// 
//     public void setDatetime(String datetime) {
//         this.datetime = datetime;
//     }
// 
//     public String getState() {
//         return state;
//     }
// 
//     public void setState(String state) {
//         this.state = state;
//     }
// 
//     public String getPicAddress() {
//         return picAddress;
//     }
// 
//     public void setPicAddress(String picAddress) {
//         this.picAddress = picAddress;
//     }
// 
//     public String getUniquecode() {
//         return uniquecode;
//     }
// 
//     public void setUniquecode(String uniquecode) {
//         this.uniquecode = uniquecode;
//     }
// }


// Path: app/src/main/java/com/leelit/stuer/dao/TreeholeDao.java
import android.content.ContentValues;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import com.leelit.stuer.bean.TreeholeLocalInfo;
import com.leelit.stuer.bean.TreeholeInfo;
import java.util.ArrayList;
import java.util.List;

            } while (cursor.moveToNext());
        }
        cursor.close();
        db.setTransactionSuccessful();
        db.endTransaction();
        return result;
    }

    public static TreeholeLocalInfo getComment(String uniquecode) {
        SQLiteDatabase db = DatabaseHelper.getInstance().getReadableDatabase();
        Cursor cursor = db.query("treehole", null, "uniquecode = ?", new String[]{uniquecode}, null, null, null);
        TreeholeLocalInfo comment = new TreeholeLocalInfo();
        cursor.moveToFirst();
        comment.setDatetime(cursor.getString(cursor.getColumnIndex(keys[0])));
        comment.setState(cursor.getString(cursor.getColumnIndex(keys[1])));
        comment.setPicAddress(cursor.getString(cursor.getColumnIndex(keys[2])));
        comment.setUniquecode(cursor.getString(cursor.getColumnIndex(keys[3])));
        comment.setLike(TRUE == cursor.getInt(cursor.getColumnIndex(keys[4])));
        comment.setUnlike(TRUE == cursor.getInt(cursor.getColumnIndex(keys[5])));
        cursor.close();
        return comment;
    }

    public static void updateLikeOfComment(String uniquecode, int isLike) {
        SQLiteDatabase db = DatabaseHelper.getInstance().getWritableDatabase();
        ContentValues values = new ContentValues();
        values.put(keys[4], isLike);
        db.update("treehole", values, "uniquecode = ?", new String[]{uniquecode});
    }

    public static void updateUnlikeOfComment(String uniquecode, int isUnlike) {