App(2)

@Entity
public class BBill{

    @Id(autoincrement = true)
    private Long id;  //本地id

    private String rid;  //服务器端id
    private float cost;  //金额
    private String content;  //内容
    private String userid;  //用户id
    private String payName;  //支付方式
    private String payImg;  //
    private String sortName;  //账单分类
    private String sortImg;  //
    private long crdate;  //创建时间
    private boolean income;  //收入支出
    private int version;  //版本

    @Generated(hash = 124482664)
    public BBill() {
    }
    @Generated(hash = 634586034)
    public BBill(Long id, String rid, float cost, String content, String userid, String payName, String payImg,
                 String sortName, String sortImg, long crdate, boolean income, int version) {
        this.id = id;
        this.rid = rid;
        this.cost = cost;
        this.content = content;
        this.userid = userid;
        this.payName = payName;
        this.payImg = payImg;
        this.sortName = sortName;
        this.sortImg = sortImg;
        this.crdate = crdate;
        this.income = income;
        this.version = version;
    }
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getRid() {
        return rid;
    }

    public void setRid(String rid) {
        this.rid = rid;
    }

    public float getCost() {
        return cost;
    }

    public void setCost(float cost) {
        this.cost = cost;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getUserid() {
        return userid;
    }

    public void setUserid(String userid) {
        this.userid = userid;
    }

    public String getPayName() {
        return payName;
    }

    public void setPayName(String payName) {
        this.payName = payName;
    }

    public String getPayImg() {
        return payImg;
    }

    public void setPayImg(String payImg) {
        this.payImg = payImg;
    }

    public String getSortName() {
        return sortName;
    }

    public void setSortName(String sortName) {
        this.sortName = sortName;
    }

    public String getSortImg() {
        return sortImg;
    }

    public void setSortImg(String sortImg) {
        this.sortImg = sortImg;
    }

    public long getCrdate() {
        return crdate;
    }

    public void setCrdate(long crdate) {
        this.crdate = crdate;
    }

    public boolean isIncome() {
        return income;
    }

    public void setIncome(boolean income) {
        this.income = income;
    }

    public int getVersion() {
        return version;
    }

    public void setVersion(int version) {
        this.version = version;
    }
    public boolean getIncome() {
        return this.income;
    }
}
package com.bill.model.gen;

import android.database.Cursor;
import android.database.sqlite.SQLiteStatement;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.Property;
import org.greenrobot.greendao.internal.DaoConfig;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.database.DatabaseStatement;

import com.copasso.cocobill.model.bean.local.BBill;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
 * DAO for table "BBILL".
*/
public class BBillDao extends AbstractDao<BBill, Long> {

    public static final String TABLENAME = "BBILL";

    /**
     * Properties of entity BBill.<br/>
     * Can be used for QueryBuilder and for referencing column names.
     */
    public static class Properties {
        public final static Property Id = new Property(0, Long.class, "id", true, "_id");
        public final static Property Rid = new Property(1, String.class, "rid", false, "RID");
        public final static Property Cost = new Property(2, float.class, "cost", false, "COST");
        public final static Property Content = new Property(3, String.class, "content", false, "CONTENT");
        public final static Property Userid = new Property(4, String.class, "userid", false, "USERID");
        public final static Property PayName = new Property(5, String.class, "payName", false, "PAY_NAME");
        public final static Property PayImg = new Property(6, String.class, "payImg", false, "PAY_IMG");
        public final static Property SortName = new Property(7, String.class, "sortName", false, "SORT_NAME");
        public final static Property SortImg = new Property(8, String.class, "sortImg", false, "SORT_IMG");
        public final static Property Crdate = new Property(9, long.class, "crdate", false, "CRDATE");
        public final static Property Income = new Property(10, boolean.class, "income", false, "INCOME");
        public final static Property Version = new Property(11, int.class, "version", false, "VERSION");
    }

    public BBillDao(DaoConfig config) {
        super(config);
    }

    public BBillDao(DaoConfig config, DaoSession daoSession) {
        super(config, daoSession);
    }

    /** Creates the underlying database table. */
    public static void createTable(Database db, boolean ifNotExists) {
        String constraint = ifNotExists? "IF NOT EXISTS ": "";
        db.execSQL("CREATE TABLE " + constraint + "\"BBILL\" (" + //
                "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id
                "\"RID\" TEXT," + // 1: rid
                "\"COST\" REAL NOT NULL ," + // 2: cost
                "\"CONTENT\" TEXT," + // 3: content
                "\"USERID\" TEXT," + // 4: userid
                "\"PAY_NAME\" TEXT," + // 5: payName
                "\"PAY_IMG\" TEXT," + // 6: payImg
                "\"SORT_NAME\" TEXT," + // 7: sortName
                "\"SORT_IMG\" TEXT," + // 8: sortImg
                "\"CRDATE\" INTEGER NOT NULL ," + // 9: crdate
                "\"INCOME\" INTEGER NOT NULL ," + // 10: income
                "\"VERSION\" INTEGER NOT NULL );"); // 11: version
    }

    /** Drops the underlying database table. */
    public static void dropTable(Database db, boolean ifExists) {
        String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"BBILL\"";
        db.execSQL(sql);
    }

    @Override
    protected final void bindValues(DatabaseStatement stmt, BBill entity) {
        stmt.clearBindings();

        Long id = entity.getId();
        if (id != null) {
            stmt.bindLong(1, id);
        }

        String rid = entity.getRid();
        if (rid != null) {
            stmt.bindString(2, rid);
        }
        stmt.bindDouble(3, entity.getCost());

        String content = entity.getContent();
        if (content != null) {
            stmt.bindString(4, content);
        }

        String userid = entity.getUserid();
        if (userid != null) {
            stmt.bindString(5, userid);
        }

        String payName = entity.getPayName();
        if (payName != null) {
            stmt.bindString(6, payName);
        }

        String payImg = entity.getPayImg();
        if (payImg != null) {
            stmt.bindString(7, payImg);
        }

        String sortName = entity.getSortName();
        if (sortName != null) {
            stmt.bindString(8, sortName);
        }

        String sortImg = entity.getSortImg();
        if (sortImg != null) {
            stmt.bindString(9, sortImg);
        }
        stmt.bindLong(10, entity.getCrdate());
        stmt.bindLong(11, entity.getIncome() ? 1L: 0L);
        stmt.bindLong(12, entity.getVersion());
    }

    @Override
    protected final void bindValues(SQLiteStatement stmt, BBill entity) {
        stmt.clearBindings();

        Long id = entity.getId();
        if (id != null) {
            stmt.bindLong(1, id);
        }

        String rid = entity.getRid();
        if (rid != null) {
            stmt.bindString(2, rid);
        }
        stmt.bindDouble(3, entity.getCost());

        String content = entity.getContent();
        if (content != null) {
            stmt.bindString(4, content);
        }

        String userid = entity.getUserid();
        if (userid != null) {
            stmt.bindString(5, userid);
        }

        String payName = entity.getPayName();
        if (payName != null) {
            stmt.bindString(6, payName);
        }

        String payImg = entity.getPayImg();
        if (payImg != null) {
            stmt.bindString(7, payImg);
        }

        String sortName = entity.getSortName();
        if (sortName != null) {
            stmt.bindString(8, sortName);
        }

        String sortImg = entity.getSortImg();
        if (sortImg != null) {
            stmt.bindString(9, sortImg);
        }
        stmt.bindLong(10, entity.getCrdate());
        stmt.bindLong(11, entity.getIncome() ? 1L: 0L);
        stmt.bindLong(12, entity.getVersion());
    }

    @Override
    public Long readKey(Cursor cursor, int offset) {
        return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0);
    }    

    @Override
    public BBill readEntity(Cursor cursor, int offset) {
        BBill entity = new BBill( //
            cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id
            cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // rid
            cursor.getFloat(offset + 2), // cost
            cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // content
            cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // userid
            cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // payName
            cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // payImg
            cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // sortName
            cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // sortImg
            cursor.getLong(offset + 9), // crdate
            cursor.getShort(offset + 10) != 0, // income
            cursor.getInt(offset + 11) // version
        );
        return entity;
    }

    @Override
    public void readEntity(Cursor cursor, BBill entity, int offset) {
        entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0));
        entity.setRid(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
        entity.setCost(cursor.getFloat(offset + 2));
        entity.setContent(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
        entity.setUserid(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4));
        entity.setPayName(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5));
        entity.setPayImg(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6));
        entity.setSortName(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7));
        entity.setSortImg(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8));
        entity.setCrdate(cursor.getLong(offset + 9));
        entity.setIncome(cursor.getShort(offset + 10) != 0);
        entity.setVersion(cursor.getInt(offset + 11));
     }

    @Override
    protected final Long updateKeyAfterInsert(BBill entity, long rowId) {
        entity.setId(rowId);
        return rowId;
    }

    @Override
    public Long getKey(BBill entity) {
        if(entity != null) {
            return entity.getId();
        } else {
            return null;
        }
    }

    @Override
    public boolean hasKey(BBill entity) {
        return entity.getId() != null;
    }

    @Override
    protected final boolean isEntityUpdateable() {
        return true;
    }

}
package com.bill.model.bean.local;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id;

/**
 * 支付方式bean
 */
@Entity
public class BPay {

    @Id
    private Long id;
    private String payName;
    private String payImg;

    private float income;
    private float outcome;

    @Generated(hash = 48271616)
    public BPay() {
    }

    @Generated(hash = 572465971)
    public BPay(Long id, String payName, String payImg, float income,
                float outcome) {
        this.id = id;
        this.payName = payName;
        this.payImg = payImg;
        this.income = income;
        this.outcome = outcome;
    }

    public String getPayName() {
        return payName;
    }

    public void setPayName(String payName) {
        this.payName = payName;
    }

    public String getPayImg() {
        return payImg;
    }

    public void setPayImg(String payImg) {
        this.payImg = payImg;
    }

    public float getIncome() {
        return income;
    }

    public void setIncome(float income) {
        this.income = income;
    }

    public float getOutcome() {
        return outcome;
    }

    public void setOutcome(float outcome) {
        this.outcome = outcome;
    }

    public Long getId() {
        return this.id;
    }

    public void setId(Long id) {
        this.id = id;
    }
}
package com.bill.model.gen;

import android.database.Cursor;
import android.database.sqlite.SQLiteStatement;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.Property;
import org.greenrobot.greendao.internal.DaoConfig;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.database.DatabaseStatement;

import com.bill.model.bean.local.BPay;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
 * DAO for table "BPAY".
*/
public class BPayDao extends AbstractDao<BPay, Long> {

    public static final String TABLENAME = "BPAY";

    /**
     * Properties of entity BPay.<br/>
     * Can be used for QueryBuilder and for referencing column names.
     */
    public static class Properties {
        public final static Property Id = new Property(0, Long.class, "id", true, "_id");
        public final static Property PayName = new Property(1, String.class, "payName", false, "PAY_NAME");
        public final static Property PayImg = new Property(2, String.class, "payImg", false, "PAY_IMG");
        public final static Property Income = new Property(3, float.class, "income", false, "INCOME");
        public final static Property Outcome = new Property(4, float.class, "outcome", false, "OUTCOME");
    }

    public BPayDao(DaoConfig config) {
        super(config);
    }

    public BPayDao(DaoConfig config, DaoSession daoSession) {
        super(config, daoSession);
    }

    /** Creates the underlying database table. */
    public static void createTable(Database db, boolean ifNotExists) {
        String constraint = ifNotExists? "IF NOT EXISTS ": "";
        db.execSQL("CREATE TABLE " + constraint + "\"BPAY\" (" + //
                "\"_id\" INTEGER PRIMARY KEY ," + // 0: id
                "\"PAY_NAME\" TEXT," + // 1: payName
                "\"PAY_IMG\" TEXT," + // 2: payImg
                "\"INCOME\" REAL NOT NULL ," + // 3: income
                "\"OUTCOME\" REAL NOT NULL );"); // 4: outcome
    }

    /** Drops the underlying database table. */
    public static void dropTable(Database db, boolean ifExists) {
        String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"BPAY\"";
        db.execSQL(sql);
    }

    @Override
    protected final void bindValues(DatabaseStatement stmt, BPay entity) {
        stmt.clearBindings();

        Long id = entity.getId();
        if (id != null) {
            stmt.bindLong(1, id);
        }

        String payName = entity.getPayName();
        if (payName != null) {
            stmt.bindString(2, payName);
        }

        String payImg = entity.getPayImg();
        if (payImg != null) {
            stmt.bindString(3, payImg);
        }
        stmt.bindDouble(4, entity.getIncome());
        stmt.bindDouble(5, entity.getOutcome());
    }

    @Override
    protected final void bindValues(SQLiteStatement stmt, BPay entity) {
        stmt.clearBindings();

        Long id = entity.getId();
        if (id != null) {
            stmt.bindLong(1, id);
        }

        String payName = entity.getPayName();
        if (payName != null) {
            stmt.bindString(2, payName);
        }

        String payImg = entity.getPayImg();
        if (payImg != null) {
            stmt.bindString(3, payImg);
        }
        stmt.bindDouble(4, entity.getIncome());
        stmt.bindDouble(5, entity.getOutcome());
    }

    @Override
    public Long readKey(Cursor cursor, int offset) {
        return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0);
    }    

    @Override
    public BPay readEntity(Cursor cursor, int offset) {
        BPay entity = new BPay( //
            cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id
            cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // payName
            cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // payImg
            cursor.getFloat(offset + 3), // income
            cursor.getFloat(offset + 4) // outcome
        );
        return entity;
    }

    @Override
    public void readEntity(Cursor cursor, BPay entity, int offset) {
        entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0));
        entity.setPayName(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
        entity.setPayImg(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
        entity.setIncome(cursor.getFloat(offset + 3));
        entity.setOutcome(cursor.getFloat(offset + 4));
     }

    @Override
    protected final Long updateKeyAfterInsert(BPay entity, long rowId) {
        entity.setId(rowId);
        return rowId;
    }

    @Override
    public Long getKey(BPay entity) {
        if(entity != null) {
            return entity.getId();
        } else {
            return null;
        }
    }

    @Override
    public boolean hasKey(BPay entity) {
        return entity.getId() != null;
    }

    @Override
    protected final boolean isEntityUpdateable() {
        return true;
    }

}

原文地址:https://www.cnblogs.com/ywqtro/p/12290591.html

时间: 2024-10-16 03:28:27

App(2)的相关文章

谈谈APP架构选型:React Native还是HBuilder

原文链接 导读:最近公司的一款新产品APP要进行研发,老大的意思想用H5来做混合APP以达到高效敏捷开发的目的.我自然就开始进行各种技术选型的调研,这里重点想说的是我最后挑选出的2款hybrid app开发技术方案:RN(react native),HBuilder.React Native是大名鼎鼎的Facebook的开源技术框架,而HBuilder是国内的H5工具开发公 司DCLOUD的产品.我自己先总结下吧:这两个技术框架在开发效率上基本上可以媲美WEB开发的速度,RN强调的是“Learn

iOS app打包 -- 生成ipa测试包 步骤详解

最近有小伙伴问我如何打成ipa包分发给测试人员 , 虽然现在网上的教程很多,但是也很杂, 没有一个比较完整的讲解. 利用工作之余, 就说一下如何生成ipa包?共分为两种方法. 第一种方法: 1) 至于配置发布证书和AdHoc描述文件, 就不再累述, 下载下来双击安装即可.(ps: 生成AdHoc描述文件的时候要注意勾选所有的设备, 只有被描述文件包含的设备才能进行相应的测试. 如果是企业账号的话则不需要添加设备的udid). 2) 接下来开始配置xCode里的工作(包括发布证书和描述文件), 注

shiro实现APP、web统一登录认证和权限管理

先说下背景,项目包含一个管理系统(web)和门户网站(web),还有一个手机APP(包括Android和IOS),三个系统共用一个后端,在后端使用shiro进行登录认证和权限控制.好的,那么问题来了web和APP都可以用shiro认证吗?两者有什么区别?如果可以,解决方案是什么?看着大家焦急的小眼神,接下来挨个解决上面的问题. web和APP可以用shiro统一登录认证吗? 可以.假如web和APP都使用密码登录的话,那没的说肯定是可以的,因为对于shiro(在此不会介绍shiro详细知识,只介

如何用一个app操作另外一个app.比如微信群控那样的

如何实现一个app.控制另外的app,比如市面上群控微信的,是用测试工具的原理?还是什么模拟点击的原理? 如何用一个app操作另外一个app.比如微信群控那样的 >> android 这个答案描述的挺清楚的:http://www.goodpm.net/postreply/android/1010000007186891/如何用一个app操作另外一个app比如微信群控那样的.html

Android App退出检测

app的退出检测是很难的,但是获取app“要退出”的状态就容易多了,退出的瞬间并不是真的退出了,ActivityManager要销毁activity,也需要一些时间和资源的. 先见下面的运行效果:  gif做的比价粗啊, 两个activity的界面就不介绍了,主要是在APP启动的时候开启一个服务,application代码如下: public class MyApplication extends Application { @Override public void onCreate() {

10大APP界面框架设计模式详解

随着移动互联网的发展,移动app已经成为了每个互联网公司的标配了,那作为产品经理,我们如何设计出更加符合用户体验的app产品呢?今天和大家分享的就是10中最常见的app界面光甲设计模式,一起来看看吧. 1.标签导航 标签导航是十大界面框架设计里最常用的界面框架设计,也是被业界之内公认的一种普遍使用的页面框架设计.那么这种页面框架设计在作业方面对一个用户来说也是最常见的一种页面框架设计,比如说微博.微信.手机百度.支付宝.淘宝,这些我们所谓的超级APP都是运用的标签导航,无一例外.从这个角度也可以

全新一点公益全返公益APP开发

全新一点公益科技开发,公益APP开发 公益软件开发 (一点公益江先生:185,2911,8412 一点公益全返, 一点公益平台开发. 一.一点公益系统是怎么玩的呢?   首先消费者注册成为一点公益的消费会员(公益信使),信使在任何一家已经入驻的商家那里进行消费,均可以参与"一点公益"消费fan利模式.   1.注册一点公益信使没有任何加盟条件和任何费用   2.注册一点公益信使之后便可以推荐别人注册成为一点公益信使   3.通过你注册的信使在公益联盟商家消费,你可以获得推荐人的激励收益

微领地小蜜app模式系统开发详解

如今企业竞争的最高境界, 不再是产品的竞争.人才的竞争.营销的竞争-- 而是一种商业模式(即赢利模式)的竞争. 微领地小蜜软件,微领地小蜜系统,小蜜APP,微领地小蜜平台,微领地小蜜开发公司,微领地小蜜服务模式,微领地小蜜商圈.O2O.C2B.B2C.F2C.B2B.C2N.C2C等微商城.App.手机网页.PC商城.小程序,微商管理系统.一物一码.防伪防窜.扫码红包.质量追溯.分销.全返.分红.拼团.互联网+直播+定制服务·系统开发提供中心. 回首过去,创新与发展裹带着机遇和挑战,微领地小蜜在

在Web.config或App.config中的添加自定义配置

.Net中的System.Configuration命名空间为我们在web.config或者app.config中自定义配置提供了完美的支持.最近看到一些项目中还在自定义xml文件做程序的配置,所以忍不住写一篇用系统自定义配置的随笔了. 如果你已经对自定义配置了如指掌,请忽略这篇文章.? 言归正传,我们先来看一个最简单的自定义配置 <?xml version="1.0" encoding="utf-8" ?> <configuration>

Android APP 调试过程中遇到的问题。

调试过过程中APP安装完启动后有的时候会异常退出,报这个错误.有的时候可以直接启动.查找不到原因.网上说把commit方法替换成commitAllowingStateLoss() 也无效. Android APP 调试过程中遇到的问题. >> android 这个答案描述的挺清楚的:http://www.goodpm.net/postreply/android/1010000007192169/AndroidAPP调试过程中遇到的问题.html