Commit b6bfdbd5 by 宁斌

1.0.9

parent 5aab5e4e
package com.gingersoft.gsa.cloud.aspectj;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Created by Wyh on 2020/2/29.
* 雙擊檢測
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface SingleClick {
/* 点击间隔时间 */
long value() default 1000;
}
package com.gingersoft.gsa.cloud.aspectj;
import android.util.Log;
import android.view.View;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.aspectj.lang.reflect.MethodSignature;
import java.lang.reflect.Method;
/**
* Created by Wyh on 2020/2/29.
*/
@Aspect
public class SingleClickAspect {
private static final long DEFAULT_TIME_INTERVAL = 5000;
/**
* 定义切点,标记切点为所有被@SingleClick注解的方法
* 注意:这里me.baron.test.annotation.SingleClick需要替换成
* 你自己项目中SingleClick这个类的全路径哦
*/
@Pointcut("execution(@com.gingersoft.gsa.cloud.aspectj.SingleClick * *(..))")
public void methodAnnotated() {
}
/**
* 定义一个切面方法,包裹切点方法
*/
@Around("methodAnnotated()")
public void aroundJoinPoint(ProceedingJoinPoint joinPoint) throws Throwable {
// 取出方法的参数
View view = null;
for (Object arg : joinPoint.getArgs()) {
if (arg instanceof View) {
view = (View) arg;
break;
}
}
if (view == null) {
return;
}
// 取出方法的注解
MethodSignature methodSignature = (MethodSignature) joinPoint.getSignature();
Method method = methodSignature.getMethod();
if (!method.isAnnotationPresent(SingleClick.class)) {
return;
}
SingleClick singleClick = method.getAnnotation(SingleClick.class);
// 判断是否快速点击
if (!XClickUtil.isFastDoubleClick(view, singleClick.value())) {
// 不是快速点击,执行原方法
joinPoint.proceed();
}
}
}
package com.gingersoft.gsa.cloud.aspectj;
import android.app.Dialog;
import android.view.View;
import com.gingersoft.gsa.cloud.base.R;
import com.gingersoft.gsa.cloud.base.utils.other.SPUtils;
import com.gingersoft.gsa.cloud.base.widget.DialogUtils;
import com.gingersoft.gsa.cloud.constans.PrintConstans;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
/**
* Created by Wyh on 2020/3/2.
* 組件化使用Aspect有問題。
*/
@Aspect
public class SwitchPrintAspect {
/**
* 定义切点,标记切点为所有被@SwitchPrintMethod注解的方法
*/
@Pointcut("execution(@com.gingersoft.gsa.cloud.aspectj.SwitchPrintMethod * *(..))")
public void methodAnnotated() {
}
/**
* 定义一个切面方法,包裹切点方法
*/
@Around("methodAnnotated()")
public void aroundJoinPoint(ProceedingJoinPoint joinPoint) {
// 取出方法的参数
View view = null;
for (Object arg : joinPoint.getArgs()) {
if (arg instanceof View) {
view = (View) arg;
break;
}
}
if (view == null || view.getContext() == null) {
return;
}
// 顯示切換打印方式的彈窗
new DialogUtils(view.getContext(), R.layout.print_select_print_method) {
@Override
public void initLayout(ViewHepler hepler, Dialog dialog) {
hepler.setViewClick(R.id.local_print, v -> {
SPUtils.put(dialog.getContext(), PrintConstans.DEFAULT_PRINT_METHOD, PrintConstans.LOCAL_PRINT);
dialog.dismiss();
});
hepler.setViewClick(R.id.internet_print, v -> {
SPUtils.put(dialog.getContext(), PrintConstans.DEFAULT_PRINT_METHOD, PrintConstans.IP_PRINT);
dialog.dismiss();
});
}
}.show();
}
}
package com.gingersoft.gsa.cloud.aspectj;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Created by Wyh on 2020/3/2.
* 切換默認打印方式
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface SwitchPrintMethod {
}
package com.gingersoft.gsa.cloud.greendao;
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.gingersoft.gsa.cloud.database.bean.ColorBean;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
* DAO for table "COLOR_BEAN".
*/
public class ColorBeanDao extends AbstractDao<ColorBean, Void> {
public static final String TABLENAME = "COLOR_BEAN";
/**
* Properties of entity ColorBean.<br/>
* Can be used for QueryBuilder and for referencing column names.
*/
public static class Properties {
public final static Property ColorId = new Property(0, int.class, "colorId", false, "COLOR_ID");
public final static Property ColorStart = new Property(1, String.class, "colorStart", false, "COLOR_START");
public final static Property ColorStop = new Property(2, String.class, "colorStop", false, "COLOR_STOP");
public final static Property FontColor = new Property(3, String.class, "fontColor", false, "FONT_COLOR");
public final static Property AndroidColor = new Property(4, String.class, "androidColor", false, "ANDROID_COLOR");
public final static Property AndroidFontColor = new Property(5, String.class, "androidFontColor", false, "ANDROID_FONT_COLOR");
public final static Property CreateTime = new Property(6, String.class, "createTime", false, "CREATE_TIME");
public final static Property EditTime = new Property(7, String.class, "editTime", false, "EDIT_TIME");
}
public ColorBeanDao(DaoConfig config) {
super(config);
}
public ColorBeanDao(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 + "\"COLOR_BEAN\" (" + //
"\"COLOR_ID\" INTEGER NOT NULL ," + // 0: colorId
"\"COLOR_START\" TEXT," + // 1: colorStart
"\"COLOR_STOP\" TEXT," + // 2: colorStop
"\"FONT_COLOR\" TEXT," + // 3: fontColor
"\"ANDROID_COLOR\" TEXT," + // 4: androidColor
"\"ANDROID_FONT_COLOR\" TEXT," + // 5: androidFontColor
"\"CREATE_TIME\" TEXT," + // 6: createTime
"\"EDIT_TIME\" TEXT);"); // 7: editTime
}
/** Drops the underlying database table. */
public static void dropTable(Database db, boolean ifExists) {
String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"COLOR_BEAN\"";
db.execSQL(sql);
}
@Override
protected final void bindValues(DatabaseStatement stmt, ColorBean entity) {
stmt.clearBindings();
stmt.bindLong(1, entity.getColorId());
String colorStart = entity.getColorStart();
if (colorStart != null) {
stmt.bindString(2, colorStart);
}
String colorStop = entity.getColorStop();
if (colorStop != null) {
stmt.bindString(3, colorStop);
}
String fontColor = entity.getFontColor();
if (fontColor != null) {
stmt.bindString(4, fontColor);
}
String androidColor = entity.getAndroidColor();
if (androidColor != null) {
stmt.bindString(5, androidColor);
}
String androidFontColor = entity.getAndroidFontColor();
if (androidFontColor != null) {
stmt.bindString(6, androidFontColor);
}
String createTime = entity.getCreateTime();
if (createTime != null) {
stmt.bindString(7, createTime);
}
String editTime = entity.getEditTime();
if (editTime != null) {
stmt.bindString(8, editTime);
}
}
@Override
protected final void bindValues(SQLiteStatement stmt, ColorBean entity) {
stmt.clearBindings();
stmt.bindLong(1, entity.getColorId());
String colorStart = entity.getColorStart();
if (colorStart != null) {
stmt.bindString(2, colorStart);
}
String colorStop = entity.getColorStop();
if (colorStop != null) {
stmt.bindString(3, colorStop);
}
String fontColor = entity.getFontColor();
if (fontColor != null) {
stmt.bindString(4, fontColor);
}
String androidColor = entity.getAndroidColor();
if (androidColor != null) {
stmt.bindString(5, androidColor);
}
String androidFontColor = entity.getAndroidFontColor();
if (androidFontColor != null) {
stmt.bindString(6, androidFontColor);
}
String createTime = entity.getCreateTime();
if (createTime != null) {
stmt.bindString(7, createTime);
}
String editTime = entity.getEditTime();
if (editTime != null) {
stmt.bindString(8, editTime);
}
}
@Override
public Void readKey(Cursor cursor, int offset) {
return null;
}
@Override
public ColorBean readEntity(Cursor cursor, int offset) {
ColorBean entity = new ColorBean( //
cursor.getInt(offset + 0), // colorId
cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // colorStart
cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // colorStop
cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // fontColor
cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // androidColor
cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // androidFontColor
cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // createTime
cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7) // editTime
);
return entity;
}
@Override
public void readEntity(Cursor cursor, ColorBean entity, int offset) {
entity.setColorId(cursor.getInt(offset + 0));
entity.setColorStart(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
entity.setColorStop(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
entity.setFontColor(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
entity.setAndroidColor(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4));
entity.setAndroidFontColor(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5));
entity.setCreateTime(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6));
entity.setEditTime(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7));
}
@Override
protected final Void updateKeyAfterInsert(ColorBean entity, long rowId) {
// Unsupported or missing PK type
return null;
}
@Override
public Void getKey(ColorBean entity) {
return null;
}
@Override
public boolean hasKey(ColorBean entity) {
// TODO
return false;
}
@Override
protected final boolean isEntityUpdateable() {
return true;
}
}
package com.gingersoft.gsa.cloud.greendao;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.util.Log;
import org.greenrobot.greendao.AbstractDaoMaster;
import org.greenrobot.greendao.database.StandardDatabase;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.database.DatabaseOpenHelper;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
* Master of DAO (schema version 20): knows all DAOs.
*/
public class DaoMaster extends AbstractDaoMaster {
public static final int SCHEMA_VERSION = 20;
/** Creates underlying database table using DAOs. */
public static void createAllTables(Database db, boolean ifNotExists) {
ColorBeanDao.createTable(db, ifNotExists);
ComboItemDao.createTable(db, ifNotExists);
DiscountDao.createTable(db, ifNotExists);
ExpandInfoDao.createTable(db, ifNotExists);
FoodDao.createTable(db, ifNotExists);
FoodComboDao.createTable(db, ifNotExists);
FoodModifierDao.createTable(db, ifNotExists);
FunctionDao.createTable(db, ifNotExists);
LanguageDao.createTable(db, ifNotExists);
ModifierDao.createTable(db, ifNotExists);
PrintCurrencyBeanDao.createTable(db, ifNotExists);
PrintModelBeanDao.createTable(db, ifNotExists);
PrinterDeviceBeanDao.createTable(db, ifNotExists);
}
/** Drops underlying database table using DAOs. */
public static void dropAllTables(Database db, boolean ifExists) {
ColorBeanDao.dropTable(db, ifExists);
ComboItemDao.dropTable(db, ifExists);
DiscountDao.dropTable(db, ifExists);
ExpandInfoDao.dropTable(db, ifExists);
FoodDao.dropTable(db, ifExists);
FoodComboDao.dropTable(db, ifExists);
FoodModifierDao.dropTable(db, ifExists);
FunctionDao.dropTable(db, ifExists);
LanguageDao.dropTable(db, ifExists);
ModifierDao.dropTable(db, ifExists);
PrintCurrencyBeanDao.dropTable(db, ifExists);
PrintModelBeanDao.dropTable(db, ifExists);
PrinterDeviceBeanDao.dropTable(db, ifExists);
}
/**
* WARNING: Drops all table on Upgrade! Use only during development.
* Convenience method using a {@link DevOpenHelper}.
*/
public static DaoSession newDevSession(Context context, String name) {
Database db = new DevOpenHelper(context, name).getWritableDb();
DaoMaster daoMaster = new DaoMaster(db);
return daoMaster.newSession();
}
public DaoMaster(SQLiteDatabase db) {
this(new StandardDatabase(db));
}
public DaoMaster(Database db) {
super(db, SCHEMA_VERSION);
registerDaoClass(ColorBeanDao.class);
registerDaoClass(ComboItemDao.class);
registerDaoClass(DiscountDao.class);
registerDaoClass(ExpandInfoDao.class);
registerDaoClass(FoodDao.class);
registerDaoClass(FoodComboDao.class);
registerDaoClass(FoodModifierDao.class);
registerDaoClass(FunctionDao.class);
registerDaoClass(LanguageDao.class);
registerDaoClass(ModifierDao.class);
registerDaoClass(PrintCurrencyBeanDao.class);
registerDaoClass(PrintModelBeanDao.class);
registerDaoClass(PrinterDeviceBeanDao.class);
}
public DaoSession newSession() {
return new DaoSession(db, IdentityScopeType.Session, daoConfigMap);
}
public DaoSession newSession(IdentityScopeType type) {
return new DaoSession(db, type, daoConfigMap);
}
/**
* Calls {@link #createAllTables(Database, boolean)} in {@link #onCreate(Database)} -
*/
public static abstract class OpenHelper extends DatabaseOpenHelper {
public OpenHelper(Context context, String name) {
super(context, name, SCHEMA_VERSION);
}
public OpenHelper(Context context, String name, CursorFactory factory) {
super(context, name, factory, SCHEMA_VERSION);
}
@Override
public void onCreate(Database db) {
Log.i("greenDAO", "Creating tables for schema version " + SCHEMA_VERSION);
createAllTables(db, false);
}
}
/** WARNING: Drops all table on Upgrade! Use only during development. */
public static class DevOpenHelper extends OpenHelper {
public DevOpenHelper(Context context, String name) {
super(context, name);
}
public DevOpenHelper(Context context, String name, CursorFactory factory) {
super(context, name, factory);
}
@Override
public void onUpgrade(Database db, int oldVersion, int newVersion) {
Log.i("greenDAO", "Upgrading schema from version " + oldVersion + " to " + newVersion + " by dropping all tables");
dropAllTables(db, true);
onCreate(db);
}
}
}
package com.gingersoft.gsa.cloud.greendao;
import java.util.Map;
import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;
import com.gingersoft.gsa.cloud.database.bean.ColorBean;
import com.gingersoft.gsa.cloud.database.bean.ComboItem;
import com.gingersoft.gsa.cloud.database.bean.Discount;
import com.gingersoft.gsa.cloud.database.bean.ExpandInfo;
import com.gingersoft.gsa.cloud.database.bean.Food;
import com.gingersoft.gsa.cloud.database.bean.FoodCombo;
import com.gingersoft.gsa.cloud.database.bean.FoodModifier;
import com.gingersoft.gsa.cloud.database.bean.Function;
import com.gingersoft.gsa.cloud.database.bean.Language;
import com.gingersoft.gsa.cloud.database.bean.Modifier;
import com.gingersoft.gsa.cloud.database.bean.PrintCurrencyBean;
import com.gingersoft.gsa.cloud.database.bean.PrintModelBean;
import com.gingersoft.gsa.cloud.database.bean.PrinterDeviceBean;
import com.gingersoft.gsa.cloud.greendao.ColorBeanDao;
import com.gingersoft.gsa.cloud.greendao.ComboItemDao;
import com.gingersoft.gsa.cloud.greendao.DiscountDao;
import com.gingersoft.gsa.cloud.greendao.ExpandInfoDao;
import com.gingersoft.gsa.cloud.greendao.FoodDao;
import com.gingersoft.gsa.cloud.greendao.FoodComboDao;
import com.gingersoft.gsa.cloud.greendao.FoodModifierDao;
import com.gingersoft.gsa.cloud.greendao.FunctionDao;
import com.gingersoft.gsa.cloud.greendao.LanguageDao;
import com.gingersoft.gsa.cloud.greendao.ModifierDao;
import com.gingersoft.gsa.cloud.greendao.PrintCurrencyBeanDao;
import com.gingersoft.gsa.cloud.greendao.PrintModelBeanDao;
import com.gingersoft.gsa.cloud.greendao.PrinterDeviceBeanDao;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
* {@inheritDoc}
*
* @see org.greenrobot.greendao.AbstractDaoSession
*/
public class DaoSession extends AbstractDaoSession {
private final DaoConfig colorBeanDaoConfig;
private final DaoConfig comboItemDaoConfig;
private final DaoConfig discountDaoConfig;
private final DaoConfig expandInfoDaoConfig;
private final DaoConfig foodDaoConfig;
private final DaoConfig foodComboDaoConfig;
private final DaoConfig foodModifierDaoConfig;
private final DaoConfig functionDaoConfig;
private final DaoConfig languageDaoConfig;
private final DaoConfig modifierDaoConfig;
private final DaoConfig printCurrencyBeanDaoConfig;
private final DaoConfig printModelBeanDaoConfig;
private final DaoConfig printerDeviceBeanDaoConfig;
private final ColorBeanDao colorBeanDao;
private final ComboItemDao comboItemDao;
private final DiscountDao discountDao;
private final ExpandInfoDao expandInfoDao;
private final FoodDao foodDao;
private final FoodComboDao foodComboDao;
private final FoodModifierDao foodModifierDao;
private final FunctionDao functionDao;
private final LanguageDao languageDao;
private final ModifierDao modifierDao;
private final PrintCurrencyBeanDao printCurrencyBeanDao;
private final PrintModelBeanDao printModelBeanDao;
private final PrinterDeviceBeanDao printerDeviceBeanDao;
public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
daoConfigMap) {
super(db);
colorBeanDaoConfig = daoConfigMap.get(ColorBeanDao.class).clone();
colorBeanDaoConfig.initIdentityScope(type);
comboItemDaoConfig = daoConfigMap.get(ComboItemDao.class).clone();
comboItemDaoConfig.initIdentityScope(type);
discountDaoConfig = daoConfigMap.get(DiscountDao.class).clone();
discountDaoConfig.initIdentityScope(type);
expandInfoDaoConfig = daoConfigMap.get(ExpandInfoDao.class).clone();
expandInfoDaoConfig.initIdentityScope(type);
foodDaoConfig = daoConfigMap.get(FoodDao.class).clone();
foodDaoConfig.initIdentityScope(type);
foodComboDaoConfig = daoConfigMap.get(FoodComboDao.class).clone();
foodComboDaoConfig.initIdentityScope(type);
foodModifierDaoConfig = daoConfigMap.get(FoodModifierDao.class).clone();
foodModifierDaoConfig.initIdentityScope(type);
functionDaoConfig = daoConfigMap.get(FunctionDao.class).clone();
functionDaoConfig.initIdentityScope(type);
languageDaoConfig = daoConfigMap.get(LanguageDao.class).clone();
languageDaoConfig.initIdentityScope(type);
modifierDaoConfig = daoConfigMap.get(ModifierDao.class).clone();
modifierDaoConfig.initIdentityScope(type);
printCurrencyBeanDaoConfig = daoConfigMap.get(PrintCurrencyBeanDao.class).clone();
printCurrencyBeanDaoConfig.initIdentityScope(type);
printModelBeanDaoConfig = daoConfigMap.get(PrintModelBeanDao.class).clone();
printModelBeanDaoConfig.initIdentityScope(type);
printerDeviceBeanDaoConfig = daoConfigMap.get(PrinterDeviceBeanDao.class).clone();
printerDeviceBeanDaoConfig.initIdentityScope(type);
colorBeanDao = new ColorBeanDao(colorBeanDaoConfig, this);
comboItemDao = new ComboItemDao(comboItemDaoConfig, this);
discountDao = new DiscountDao(discountDaoConfig, this);
expandInfoDao = new ExpandInfoDao(expandInfoDaoConfig, this);
foodDao = new FoodDao(foodDaoConfig, this);
foodComboDao = new FoodComboDao(foodComboDaoConfig, this);
foodModifierDao = new FoodModifierDao(foodModifierDaoConfig, this);
functionDao = new FunctionDao(functionDaoConfig, this);
languageDao = new LanguageDao(languageDaoConfig, this);
modifierDao = new ModifierDao(modifierDaoConfig, this);
printCurrencyBeanDao = new PrintCurrencyBeanDao(printCurrencyBeanDaoConfig, this);
printModelBeanDao = new PrintModelBeanDao(printModelBeanDaoConfig, this);
printerDeviceBeanDao = new PrinterDeviceBeanDao(printerDeviceBeanDaoConfig, this);
registerDao(ColorBean.class, colorBeanDao);
registerDao(ComboItem.class, comboItemDao);
registerDao(Discount.class, discountDao);
registerDao(ExpandInfo.class, expandInfoDao);
registerDao(Food.class, foodDao);
registerDao(FoodCombo.class, foodComboDao);
registerDao(FoodModifier.class, foodModifierDao);
registerDao(Function.class, functionDao);
registerDao(Language.class, languageDao);
registerDao(Modifier.class, modifierDao);
registerDao(PrintCurrencyBean.class, printCurrencyBeanDao);
registerDao(PrintModelBean.class, printModelBeanDao);
registerDao(PrinterDeviceBean.class, printerDeviceBeanDao);
}
public void clear() {
colorBeanDaoConfig.clearIdentityScope();
comboItemDaoConfig.clearIdentityScope();
discountDaoConfig.clearIdentityScope();
expandInfoDaoConfig.clearIdentityScope();
foodDaoConfig.clearIdentityScope();
foodComboDaoConfig.clearIdentityScope();
foodModifierDaoConfig.clearIdentityScope();
functionDaoConfig.clearIdentityScope();
languageDaoConfig.clearIdentityScope();
modifierDaoConfig.clearIdentityScope();
printCurrencyBeanDaoConfig.clearIdentityScope();
printModelBeanDaoConfig.clearIdentityScope();
printerDeviceBeanDaoConfig.clearIdentityScope();
}
public ColorBeanDao getColorBeanDao() {
return colorBeanDao;
}
public ComboItemDao getComboItemDao() {
return comboItemDao;
}
public DiscountDao getDiscountDao() {
return discountDao;
}
public ExpandInfoDao getExpandInfoDao() {
return expandInfoDao;
}
public FoodDao getFoodDao() {
return foodDao;
}
public FoodComboDao getFoodComboDao() {
return foodComboDao;
}
public FoodModifierDao getFoodModifierDao() {
return foodModifierDao;
}
public FunctionDao getFunctionDao() {
return functionDao;
}
public LanguageDao getLanguageDao() {
return languageDao;
}
public ModifierDao getModifierDao() {
return modifierDao;
}
public PrintCurrencyBeanDao getPrintCurrencyBeanDao() {
return printCurrencyBeanDao;
}
public PrintModelBeanDao getPrintModelBeanDao() {
return printModelBeanDao;
}
public PrinterDeviceBeanDao getPrinterDeviceBeanDao() {
return printerDeviceBeanDao;
}
}
package com.gingersoft.gsa.cloud.greendao;
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.gingersoft.gsa.cloud.database.bean.Discount;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
* DAO for table "DISCOUNT".
*/
public class DiscountDao extends AbstractDao<Discount, Long> {
public static final String TABLENAME = "DISCOUNT";
/**
* Properties of entity Discount.<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 Restaurant_id = new Property(1, int.class, "restaurant_id", false, "RESTAURANT_ID");
public final static Property Amount = new Property(2, double.class, "amount", false, "AMOUNT");
public final static Property Discount_value = new Property(3, double.class, "discount_value", false, "DISCOUNT_VALUE");
public final static Property Type = new Property(4, int.class, "type", false, "TYPE");
public final static Property DiscountType = new Property(5, String.class, "discountType", false, "DISCOUNT_TYPE");
public final static Property Status = new Property(6, int.class, "status", false, "STATUS");
public final static Property Remark = new Property(7, String.class, "remark", false, "REMARK");
public final static Property Begin_time = new Property(8, String.class, "begin_time", false, "BEGIN_TIME");
public final static Property End_time = new Property(9, String.class, "end_time", false, "END_TIME");
}
public DiscountDao(DaoConfig config) {
super(config);
}
public DiscountDao(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 + "\"DISCOUNT\" (" + //
"\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id
"\"RESTAURANT_ID\" INTEGER NOT NULL ," + // 1: restaurant_id
"\"AMOUNT\" REAL NOT NULL ," + // 2: amount
"\"DISCOUNT_VALUE\" REAL NOT NULL ," + // 3: discount_value
"\"TYPE\" INTEGER NOT NULL ," + // 4: type
"\"DISCOUNT_TYPE\" TEXT," + // 5: discountType
"\"STATUS\" INTEGER NOT NULL ," + // 6: status
"\"REMARK\" TEXT," + // 7: remark
"\"BEGIN_TIME\" TEXT," + // 8: begin_time
"\"END_TIME\" TEXT);"); // 9: end_time
}
/** Drops the underlying database table. */
public static void dropTable(Database db, boolean ifExists) {
String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"DISCOUNT\"";
db.execSQL(sql);
}
@Override
protected final void bindValues(DatabaseStatement stmt, Discount entity) {
stmt.clearBindings();
Long id = entity.getId();
if (id != null) {
stmt.bindLong(1, id);
}
stmt.bindLong(2, entity.getRestaurant_id());
stmt.bindDouble(3, entity.getAmount());
stmt.bindDouble(4, entity.getDiscount_value());
stmt.bindLong(5, entity.getType());
String discountType = entity.getDiscountType();
if (discountType != null) {
stmt.bindString(6, discountType);
}
stmt.bindLong(7, entity.getStatus());
String remark = entity.getRemark();
if (remark != null) {
stmt.bindString(8, remark);
}
String begin_time = entity.getBegin_time();
if (begin_time != null) {
stmt.bindString(9, begin_time);
}
String end_time = entity.getEnd_time();
if (end_time != null) {
stmt.bindString(10, end_time);
}
}
@Override
protected final void bindValues(SQLiteStatement stmt, Discount entity) {
stmt.clearBindings();
Long id = entity.getId();
if (id != null) {
stmt.bindLong(1, id);
}
stmt.bindLong(2, entity.getRestaurant_id());
stmt.bindDouble(3, entity.getAmount());
stmt.bindDouble(4, entity.getDiscount_value());
stmt.bindLong(5, entity.getType());
String discountType = entity.getDiscountType();
if (discountType != null) {
stmt.bindString(6, discountType);
}
stmt.bindLong(7, entity.getStatus());
String remark = entity.getRemark();
if (remark != null) {
stmt.bindString(8, remark);
}
String begin_time = entity.getBegin_time();
if (begin_time != null) {
stmt.bindString(9, begin_time);
}
String end_time = entity.getEnd_time();
if (end_time != null) {
stmt.bindString(10, end_time);
}
}
@Override
public Long readKey(Cursor cursor, int offset) {
return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0);
}
@Override
public Discount readEntity(Cursor cursor, int offset) {
Discount entity = new Discount( //
cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id
cursor.getInt(offset + 1), // restaurant_id
cursor.getDouble(offset + 2), // amount
cursor.getDouble(offset + 3), // discount_value
cursor.getInt(offset + 4), // type
cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // discountType
cursor.getInt(offset + 6), // status
cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // remark
cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8), // begin_time
cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9) // end_time
);
return entity;
}
@Override
public void readEntity(Cursor cursor, Discount entity, int offset) {
entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0));
entity.setRestaurant_id(cursor.getInt(offset + 1));
entity.setAmount(cursor.getDouble(offset + 2));
entity.setDiscount_value(cursor.getDouble(offset + 3));
entity.setType(cursor.getInt(offset + 4));
entity.setDiscountType(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5));
entity.setStatus(cursor.getInt(offset + 6));
entity.setRemark(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7));
entity.setBegin_time(cursor.isNull(offset + 8) ? null : cursor.getString(offset + 8));
entity.setEnd_time(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9));
}
@Override
protected final Long updateKeyAfterInsert(Discount entity, long rowId) {
entity.setId(rowId);
return rowId;
}
@Override
public Long getKey(Discount entity) {
if(entity != null) {
return entity.getId();
} else {
return null;
}
}
@Override
public boolean hasKey(Discount entity) {
return entity.getId() != null;
}
@Override
protected final boolean isEntityUpdateable() {
return true;
}
}
package com.gingersoft.gsa.cloud.greendao;
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.gingersoft.gsa.cloud.database.bean.ExpandInfo;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
* DAO for table "EXPAND_INFO".
*/
public class ExpandInfoDao extends AbstractDao<ExpandInfo, Long> {
public static final String TABLENAME = "EXPAND_INFO";
/**
* Properties of entity ExpandInfo.<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 RestaurantId = new Property(1, Integer.class, "restaurantId", false, "RESTAURANT_ID");
public final static Property SettingName = new Property(2, String.class, "settingName", false, "SETTING_NAME");
public final static Property ValueInt = new Property(3, Integer.class, "valueInt", false, "VALUE_INT");
public final static Property ValueChar = new Property(4, String.class, "valueChar", false, "VALUE_CHAR");
public final static Property ValueBoolean = new Property(5, Boolean.class, "valueBoolean", false, "VALUE_BOOLEAN");
public final static Property ValueDatetime = new Property(6, String.class, "valueDatetime", false, "VALUE_DATETIME");
public final static Property Remark = new Property(7, String.class, "remark", false, "REMARK");
public final static Property DataType = new Property(8, int.class, "dataType", false, "DATA_TYPE");
public final static Property ShowName = new Property(9, String.class, "showName", false, "SHOW_NAME");
}
public ExpandInfoDao(DaoConfig config) {
super(config);
}
public ExpandInfoDao(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 + "\"EXPAND_INFO\" (" + //
"\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id
"\"RESTAURANT_ID\" INTEGER," + // 1: restaurantId
"\"SETTING_NAME\" TEXT," + // 2: settingName
"\"VALUE_INT\" INTEGER," + // 3: valueInt
"\"VALUE_CHAR\" TEXT," + // 4: valueChar
"\"VALUE_BOOLEAN\" INTEGER," + // 5: valueBoolean
"\"VALUE_DATETIME\" TEXT," + // 6: valueDatetime
"\"REMARK\" TEXT," + // 7: remark
"\"DATA_TYPE\" INTEGER NOT NULL ," + // 8: dataType
"\"SHOW_NAME\" TEXT);"); // 9: showName
}
/** Drops the underlying database table. */
public static void dropTable(Database db, boolean ifExists) {
String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"EXPAND_INFO\"";
db.execSQL(sql);
}
@Override
protected final void bindValues(DatabaseStatement stmt, ExpandInfo entity) {
stmt.clearBindings();
Long id = entity.getId();
if (id != null) {
stmt.bindLong(1, id);
}
Integer restaurantId = entity.getRestaurantId();
if (restaurantId != null) {
stmt.bindLong(2, restaurantId);
}
String settingName = entity.getSettingName();
if (settingName != null) {
stmt.bindString(3, settingName);
}
Integer valueInt = entity.getValueInt();
if (valueInt != null) {
stmt.bindLong(4, valueInt);
}
String valueChar = entity.getValueChar();
if (valueChar != null) {
stmt.bindString(5, valueChar);
}
Boolean valueBoolean = entity.getValueBoolean();
if (valueBoolean != null) {
stmt.bindLong(6, valueBoolean ? 1L: 0L);
}
String valueDatetime = entity.getValueDatetime();
if (valueDatetime != null) {
stmt.bindString(7, valueDatetime);
}
String remark = entity.getRemark();
if (remark != null) {
stmt.bindString(8, remark);
}
stmt.bindLong(9, entity.getDataType());
String showName = entity.getShowName();
if (showName != null) {
stmt.bindString(10, showName);
}
}
@Override
protected final void bindValues(SQLiteStatement stmt, ExpandInfo entity) {
stmt.clearBindings();
Long id = entity.getId();
if (id != null) {
stmt.bindLong(1, id);
}
Integer restaurantId = entity.getRestaurantId();
if (restaurantId != null) {
stmt.bindLong(2, restaurantId);
}
String settingName = entity.getSettingName();
if (settingName != null) {
stmt.bindString(3, settingName);
}
Integer valueInt = entity.getValueInt();
if (valueInt != null) {
stmt.bindLong(4, valueInt);
}
String valueChar = entity.getValueChar();
if (valueChar != null) {
stmt.bindString(5, valueChar);
}
Boolean valueBoolean = entity.getValueBoolean();
if (valueBoolean != null) {
stmt.bindLong(6, valueBoolean ? 1L: 0L);
}
String valueDatetime = entity.getValueDatetime();
if (valueDatetime != null) {
stmt.bindString(7, valueDatetime);
}
String remark = entity.getRemark();
if (remark != null) {
stmt.bindString(8, remark);
}
stmt.bindLong(9, entity.getDataType());
String showName = entity.getShowName();
if (showName != null) {
stmt.bindString(10, showName);
}
}
@Override
public Long readKey(Cursor cursor, int offset) {
return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0);
}
@Override
public ExpandInfo readEntity(Cursor cursor, int offset) {
ExpandInfo entity = new ExpandInfo( //
cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id
cursor.isNull(offset + 1) ? null : cursor.getInt(offset + 1), // restaurantId
cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // settingName
cursor.isNull(offset + 3) ? null : cursor.getInt(offset + 3), // valueInt
cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4), // valueChar
cursor.isNull(offset + 5) ? null : cursor.getShort(offset + 5) != 0, // valueBoolean
cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // valueDatetime
cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // remark
cursor.getInt(offset + 8), // dataType
cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9) // showName
);
return entity;
}
@Override
public void readEntity(Cursor cursor, ExpandInfo entity, int offset) {
entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0));
entity.setRestaurantId(cursor.isNull(offset + 1) ? null : cursor.getInt(offset + 1));
entity.setSettingName(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
entity.setValueInt(cursor.isNull(offset + 3) ? null : cursor.getInt(offset + 3));
entity.setValueChar(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4));
entity.setValueBoolean(cursor.isNull(offset + 5) ? null : cursor.getShort(offset + 5) != 0);
entity.setValueDatetime(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6));
entity.setRemark(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7));
entity.setDataType(cursor.getInt(offset + 8));
entity.setShowName(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9));
}
@Override
protected final Long updateKeyAfterInsert(ExpandInfo entity, long rowId) {
entity.setId(rowId);
return rowId;
}
@Override
public Long getKey(ExpandInfo entity) {
if(entity != null) {
return entity.getId();
} else {
return null;
}
}
@Override
public boolean hasKey(ExpandInfo entity) {
return entity.getId() != null;
}
@Override
protected final boolean isEntityUpdateable() {
return true;
}
}
package com.gingersoft.gsa.cloud.greendao;
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.gingersoft.gsa.cloud.database.bean.Function;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
* DAO for table "FUNCTION".
*/
public class FunctionDao extends AbstractDao<Function, Long> {
public static final String TABLENAME = "FUNCTION";
/**
* Properties of entity Function.<br/>
* Can be used for QueryBuilder and for referencing column names.
*/
public static class Properties {
public final static Property Dbid = new Property(0, Long.class, "dbid", true, "_id");
public final static Property Id = new Property(1, Long.class, "id", false, "ID");
public final static Property ParentId = new Property(2, int.class, "parentId", false, "PARENT_ID");
public final static Property GroupId = new Property(3, int.class, "groupId", false, "GROUP_ID");
public final static Property EffectiveTime = new Property(4, long.class, "effectiveTime", false, "EFFECTIVE_TIME");
public final static Property ResName = new Property(5, String.class, "resName", false, "RES_NAME");
public final static Property ResUrl = new Property(6, String.class, "resUrl", false, "RES_URL");
public final static Property ImageURL = new Property(7, String.class, "imageURL", false, "IMAGE_URL");
public final static Property IcRes = new Property(8, int.class, "icRes", false, "IC_RES");
public final static Property Status = new Property(9, int.class, "status", false, "STATUS");
}
public FunctionDao(DaoConfig config) {
super(config);
}
public FunctionDao(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 + "\"FUNCTION\" (" + //
"\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: dbid
"\"ID\" INTEGER NOT NULL ," + // 1: id
"\"PARENT_ID\" INTEGER NOT NULL ," + // 2: parentId
"\"GROUP_ID\" INTEGER NOT NULL ," + // 3: groupId
"\"EFFECTIVE_TIME\" INTEGER NOT NULL ," + // 4: effectiveTime
"\"RES_NAME\" TEXT," + // 5: resName
"\"RES_URL\" TEXT," + // 6: resUrl
"\"IMAGE_URL\" TEXT," + // 7: imageURL
"\"IC_RES\" INTEGER NOT NULL ," + // 8: icRes
"\"STATUS\" INTEGER NOT NULL );"); // 9: status
}
/** Drops the underlying database table. */
public static void dropTable(Database db, boolean ifExists) {
String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"FUNCTION\"";
db.execSQL(sql);
}
@Override
protected final void bindValues(DatabaseStatement stmt, Function entity) {
stmt.clearBindings();
Long dbid = entity.getDbid();
if (dbid != null) {
stmt.bindLong(1, dbid);
}
stmt.bindLong(2, entity.getId());
stmt.bindLong(3, entity.getParentId());
stmt.bindLong(4, entity.getGroupId());
stmt.bindLong(5, entity.getEffectiveTime());
String resName = entity.getResName();
if (resName != null) {
stmt.bindString(6, resName);
}
String resUrl = entity.getResUrl();
if (resUrl != null) {
stmt.bindString(7, resUrl);
}
String imageURL = entity.getImageURL();
if (imageURL != null) {
stmt.bindString(8, imageURL);
}
stmt.bindLong(9, entity.getIcRes());
stmt.bindLong(10, entity.getStatus());
}
@Override
protected final void bindValues(SQLiteStatement stmt, Function entity) {
stmt.clearBindings();
Long dbid = entity.getDbid();
if (dbid != null) {
stmt.bindLong(1, dbid);
}
stmt.bindLong(2, entity.getId());
stmt.bindLong(3, entity.getParentId());
stmt.bindLong(4, entity.getGroupId());
stmt.bindLong(5, entity.getEffectiveTime());
String resName = entity.getResName();
if (resName != null) {
stmt.bindString(6, resName);
}
String resUrl = entity.getResUrl();
if (resUrl != null) {
stmt.bindString(7, resUrl);
}
String imageURL = entity.getImageURL();
if (imageURL != null) {
stmt.bindString(8, imageURL);
}
stmt.bindLong(9, entity.getIcRes());
stmt.bindLong(10, entity.getStatus());
}
@Override
public Long readKey(Cursor cursor, int offset) {
return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0);
}
@Override
public Function readEntity(Cursor cursor, int offset) {
Function entity = new Function( //
cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // dbid
cursor.getLong(offset + 1), // id
cursor.getInt(offset + 2), // parentId
cursor.getInt(offset + 3), // groupId
cursor.getLong(offset + 4), // effectiveTime
cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5), // resName
cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6), // resUrl
cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7), // imageURL
cursor.getInt(offset + 8), // icRes
cursor.getInt(offset + 9) // status
);
return entity;
}
@Override
public void readEntity(Cursor cursor, Function entity, int offset) {
entity.setDbid(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0));
entity.setId(cursor.getLong(offset + 1));
entity.setParentId(cursor.getInt(offset + 2));
entity.setGroupId(cursor.getInt(offset + 3));
entity.setEffectiveTime(cursor.getLong(offset + 4));
entity.setResName(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5));
entity.setResUrl(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6));
entity.setImageURL(cursor.isNull(offset + 7) ? null : cursor.getString(offset + 7));
entity.setIcRes(cursor.getInt(offset + 8));
entity.setStatus(cursor.getInt(offset + 9));
}
@Override
protected final Long updateKeyAfterInsert(Function entity, long rowId) {
entity.setDbid(rowId);
return rowId;
}
@Override
public Long getKey(Function entity) {
if(entity != null) {
return entity.getDbid();
} else {
return null;
}
}
@Override
public boolean hasKey(Function entity) {
return entity.getDbid() != null;
}
@Override
protected final boolean isEntityUpdateable() {
return true;
}
}
package com.gingersoft.gsa.cloud.greendao;
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.gingersoft.gsa.cloud.database.bean.Language;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
* DAO for table "LANGUAGE".
*/
public class LanguageDao extends AbstractDao<Language, Long> {
public static final String TABLENAME = "LANGUAGE";
/**
* Properties of entity Language.<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 FunctionName = new Property(1, String.class, "functionName", false, "FUNCTION_NAME");
public final static Property LanguageName = new Property(2, String.class, "languageName", false, "LANGUAGE_NAME");
}
public LanguageDao(DaoConfig config) {
super(config);
}
public LanguageDao(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 + "\"LANGUAGE\" (" + //
"\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id
"\"FUNCTION_NAME\" TEXT NOT NULL ," + // 1: functionName
"\"LANGUAGE_NAME\" TEXT);"); // 2: languageName
}
/** Drops the underlying database table. */
public static void dropTable(Database db, boolean ifExists) {
String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"LANGUAGE\"";
db.execSQL(sql);
}
@Override
protected final void bindValues(DatabaseStatement stmt, Language entity) {
stmt.clearBindings();
Long id = entity.getId();
if (id != null) {
stmt.bindLong(1, id);
}
stmt.bindString(2, entity.getFunctionName());
String languageName = entity.getLanguageName();
if (languageName != null) {
stmt.bindString(3, languageName);
}
}
@Override
protected final void bindValues(SQLiteStatement stmt, Language entity) {
stmt.clearBindings();
Long id = entity.getId();
if (id != null) {
stmt.bindLong(1, id);
}
stmt.bindString(2, entity.getFunctionName());
String languageName = entity.getLanguageName();
if (languageName != null) {
stmt.bindString(3, languageName);
}
}
@Override
public Long readKey(Cursor cursor, int offset) {
return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0);
}
@Override
public Language readEntity(Cursor cursor, int offset) {
Language entity = new Language( //
cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id
cursor.getString(offset + 1), // functionName
cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2) // languageName
);
return entity;
}
@Override
public void readEntity(Cursor cursor, Language entity, int offset) {
entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0));
entity.setFunctionName(cursor.getString(offset + 1));
entity.setLanguageName(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
}
@Override
protected final Long updateKeyAfterInsert(Language entity, long rowId) {
entity.setId(rowId);
return rowId;
}
@Override
public Long getKey(Language entity) {
if(entity != null) {
return entity.getId();
} else {
return null;
}
}
@Override
public boolean hasKey(Language entity) {
return entity.getId() != null;
}
@Override
protected final boolean isEntityUpdateable() {
return true;
}
}
package com.gingersoft.gsa.cloud.greendao;
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.gingersoft.gsa.cloud.database.bean.PrintModelBean;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
* DAO for table "PRINT_MODEL_BEAN".
*/
public class PrintModelBeanDao extends AbstractDao<PrintModelBean, Long> {
public static final String TABLENAME = "PRINT_MODEL_BEAN";
/**
* Properties of entity PrintModelBean.<br/>
* Can be used for QueryBuilder and for referencing column names.
*/
public static class Properties {
public final static Property Dbid = new Property(0, Long.class, "dbid", true, "_id");
public final static Property Id = new Property(1, int.class, "id", false, "ID");
public final static Property PaperSpecification = new Property(2, String.class, "paperSpecification", false, "PAPER_SPECIFICATION");
public final static Property PrinterName = new Property(3, String.class, "printerName", false, "PRINTER_NAME");
public final static Property Model = new Property(4, String.class, "model", false, "MODEL");
}
public PrintModelBeanDao(DaoConfig config) {
super(config);
}
public PrintModelBeanDao(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 + "\"PRINT_MODEL_BEAN\" (" + //
"\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: dbid
"\"ID\" INTEGER NOT NULL ," + // 1: id
"\"PAPER_SPECIFICATION\" TEXT," + // 2: paperSpecification
"\"PRINTER_NAME\" TEXT," + // 3: printerName
"\"MODEL\" TEXT);"); // 4: model
}
/** Drops the underlying database table. */
public static void dropTable(Database db, boolean ifExists) {
String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"PRINT_MODEL_BEAN\"";
db.execSQL(sql);
}
@Override
protected final void bindValues(DatabaseStatement stmt, PrintModelBean entity) {
stmt.clearBindings();
Long dbid = entity.getDbid();
if (dbid != null) {
stmt.bindLong(1, dbid);
}
stmt.bindLong(2, entity.getId());
String paperSpecification = entity.getPaperSpecification();
if (paperSpecification != null) {
stmt.bindString(3, paperSpecification);
}
String printerName = entity.getPrinterName();
if (printerName != null) {
stmt.bindString(4, printerName);
}
String model = entity.getModel();
if (model != null) {
stmt.bindString(5, model);
}
}
@Override
protected final void bindValues(SQLiteStatement stmt, PrintModelBean entity) {
stmt.clearBindings();
Long dbid = entity.getDbid();
if (dbid != null) {
stmt.bindLong(1, dbid);
}
stmt.bindLong(2, entity.getId());
String paperSpecification = entity.getPaperSpecification();
if (paperSpecification != null) {
stmt.bindString(3, paperSpecification);
}
String printerName = entity.getPrinterName();
if (printerName != null) {
stmt.bindString(4, printerName);
}
String model = entity.getModel();
if (model != null) {
stmt.bindString(5, model);
}
}
@Override
public Long readKey(Cursor cursor, int offset) {
return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0);
}
@Override
public PrintModelBean readEntity(Cursor cursor, int offset) {
PrintModelBean entity = new PrintModelBean( //
cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // dbid
cursor.getInt(offset + 1), // id
cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // paperSpecification
cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // printerName
cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4) // model
);
return entity;
}
@Override
public void readEntity(Cursor cursor, PrintModelBean entity, int offset) {
entity.setDbid(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0));
entity.setId(cursor.getInt(offset + 1));
entity.setPaperSpecification(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
entity.setPrinterName(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
entity.setModel(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4));
}
@Override
protected final Long updateKeyAfterInsert(PrintModelBean entity, long rowId) {
entity.setDbid(rowId);
return rowId;
}
@Override
public Long getKey(PrintModelBean entity) {
if(entity != null) {
return entity.getDbid();
} else {
return null;
}
}
@Override
public boolean hasKey(PrintModelBean entity) {
return entity.getDbid() != null;
}
@Override
protected final boolean isEntityUpdateable() {
return true;
}
}
...@@ -233,7 +233,6 @@ public class SoldoutCtrlActivity extends BaseFragmentActivity<SoldoutCtrlPresent ...@@ -233,7 +233,6 @@ public class SoldoutCtrlActivity extends BaseFragmentActivity<SoldoutCtrlPresent
//总的页数向上取整 //总的页数向上取整
totalPage = (int) Math.ceil(foodGroupList.size() * 1.0 / GoldConstants.foodGriupPageSize); totalPage = (int) Math.ceil(foodGroupList.size() * 1.0 / GoldConstants.foodGriupPageSize);
int Rows = foodGroupRow; int Rows = foodGroupRow;
if (foodGroupList.size() <= foodGroupColumn) { if (foodGroupList.size() <= foodGroupColumn) {
Rows = 1; Rows = 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment