public class DbSetup extends Object
Modifier and Type | Field and Description |
---|---|
static String |
POSPER_SCHEMA |
Modifier and Type | Method and Description |
---|---|
static Category |
addSampleCategory(String name,
int visibleId,
Category parent) |
static Customer |
addSampleCustomer(String name,
String code,
String city,
String provstate,
String fax,
String phone,
String postal,
String contact,
String street,
Tax tax,
CustomerGroup group,
int pin) |
static CustomerGroup |
addSampleCustomerGroup(String name) |
static DiscountReason |
addSampleDiscountReason(String name) |
static Floor |
addSampleFloor(String name,
int visibleId) |
static Place |
addSamplePlace(String name,
Floor floor,
int x,
int y) |
static Product |
addSampleProduct(Category c,
String ref,
Tax tax,
String prodName,
String barcode,
double buy,
double sell,
double volume,
boolean instock,
boolean com,
boolean scale) |
static Tax |
addSampleTax(String name,
int visibleId,
double rate) |
static void |
loadSampleData(AppView appView)
This method provides some sample data for use during testing.
|
static void |
populateDatabase()
Given a current empty database insert all the default values.
|
static void |
setDbVersionCurrent()
This method is only used when POSper creates a new database, i.e. the
POSPER_VERSION property value tells which POSper build has originally created
the database.
|
public static final String POSPER_SCHEMA
public static void populateDatabase() throws BasicException
BasicException
public static Product addSampleProduct(Category c, String ref, Tax tax, String prodName, String barcode, double buy, double sell, double volume, boolean instock, boolean com, boolean scale) throws BasicException
BasicException
public static Category addSampleCategory(String name, int visibleId, Category parent) throws BasicException
BasicException
public static Floor addSampleFloor(String name, int visibleId) throws BasicException
BasicException
public static Place addSamplePlace(String name, Floor floor, int x, int y) throws BasicException
BasicException
public static Tax addSampleTax(String name, int visibleId, double rate) throws BasicException
BasicException
public static CustomerGroup addSampleCustomerGroup(String name) throws BasicException
BasicException
public static Customer addSampleCustomer(String name, String code, String city, String provstate, String fax, String phone, String postal, String contact, String street, Tax tax, CustomerGroup group, int pin) throws BasicException
BasicException
public static DiscountReason addSampleDiscountReason(String name) throws BasicException
BasicException
public static void loadSampleData(AppView appView) throws BasicException
appView
- BasicException
public static void setDbVersionCurrent() throws BasicException
BasicException
Copyright © 2021. All rights reserved.