mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2026-07-31 07:44:24 +02:00
WIP: more work, compile again
This commit is contained in:
@@ -30,6 +30,7 @@ public class GBDaoGenerator {
|
||||
public static final String VALID_TO_UTC = "validToUTC";
|
||||
private static final String MAIN_PACKAGE = "nodomain.freeyourgadget.gadgetbridge";
|
||||
private static final String MODEL_PACKAGE = MAIN_PACKAGE + ".model";
|
||||
private static final String VALID_BY_DATE = MODEL_PACKAGE + ".ValidByDate";
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
Schema schema = new Schema(7, MAIN_PACKAGE + ".entities");
|
||||
@@ -89,12 +90,18 @@ public class GBDaoGenerator {
|
||||
userAttributes.addIntProperty("weightKG").notNull();
|
||||
userAttributes.addIntProperty("sleepGoalHPD");
|
||||
userAttributes.addIntProperty("stepsGoalSPD");
|
||||
userAttributes.addDateProperty(VALID_FROM_UTC);
|
||||
userAttributes.addDateProperty(VALID_TO_UTC);
|
||||
addDateValidityTo(userAttributes);
|
||||
|
||||
return userAttributes;
|
||||
}
|
||||
|
||||
private static void addDateValidityTo(Entity entity) {
|
||||
entity.addDateProperty(VALID_FROM_UTC);
|
||||
entity.addDateProperty(VALID_TO_UTC);
|
||||
|
||||
entity.implementsInterface(VALID_BY_DATE);
|
||||
}
|
||||
|
||||
private static Entity addDevice(Schema schema, Entity deviceAttributes) {
|
||||
Entity device = addEntity(schema, "Device");
|
||||
device.addIdProperty();
|
||||
@@ -114,8 +121,7 @@ public class GBDaoGenerator {
|
||||
deviceAttributes.addIdProperty();
|
||||
deviceAttributes.addStringProperty("firmwareVersion1").notNull();
|
||||
deviceAttributes.addStringProperty("firmwareVersion2");
|
||||
deviceAttributes.addDateProperty(VALID_FROM_UTC);
|
||||
deviceAttributes.addDateProperty(VALID_TO_UTC);
|
||||
addDateValidityTo(deviceAttributes);
|
||||
|
||||
return deviceAttributes;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user