Skip to content

Commit

Permalink
Cleaned up field names
Browse files Browse the repository at this point in the history
  • Loading branch information
hylkevds committed Feb 6, 2019
1 parent 5c885b9 commit 37574b4
Show file tree
Hide file tree
Showing 14 changed files with 61 additions and 70 deletions.
Expand Up @@ -484,31 +484,31 @@ public boolean entityExists(PostgresPersistenceManager<J> pm, Entity e) {
return entityExists(pm, e.getEntityType(), e.getId());
}

public static void insertTimeValue(Map<Field, Object> clause, Field<OffsetDateTime> startPath, Field<OffsetDateTime> endPath, TimeValue time) {
public static void insertTimeValue(Map<Field, Object> clause, Field<OffsetDateTime> startField, Field<OffsetDateTime> endField, TimeValue time) {
if (time instanceof TimeInstant) {
TimeInstant timeInstant = (TimeInstant) time;
insertTimeInstant(clause, endPath, timeInstant);
insertTimeInstant(clause, startPath, timeInstant);
insertTimeInstant(clause, endField, timeInstant);
insertTimeInstant(clause, startField, timeInstant);
} else if (time instanceof TimeInterval) {
TimeInterval timeInterval = (TimeInterval) time;
insertTimeInterval(clause, startPath, endPath, timeInterval);
insertTimeInterval(clause, startField, endField, timeInterval);
}
}

public static void insertTimeInstant(Map<Field, Object> clause, Field<OffsetDateTime> path, TimeInstant time) {
public static void insertTimeInstant(Map<Field, Object> clause, Field<OffsetDateTime> field, TimeInstant time) {
if (time == null) {
return;
}
clause.put(path, time.getOffsetDateTime());
clause.put(field, time.getOffsetDateTime());
}

public static void insertTimeInterval(Map<Field, Object> clause, Field<OffsetDateTime> startPath, Field<OffsetDateTime> endPath, TimeInterval time) {
public static void insertTimeInterval(Map<Field, Object> clause, Field<OffsetDateTime> startField, Field<OffsetDateTime> endField, TimeInterval time) {
if (time == null) {
return;
}
Interval interval = time.getInterval();
clause.put(startPath, OffsetDateTime.ofInstant(Instant.ofEpochMilli(interval.getStartMillis()), UTC));
clause.put(endPath, OffsetDateTime.ofInstant(Instant.ofEpochMilli(interval.getEndMillis()), UTC));
clause.put(startField, OffsetDateTime.ofInstant(Instant.ofEpochMilli(interval.getStartMillis()), UTC));
clause.put(endField, OffsetDateTime.ofInstant(Instant.ofEpochMilli(interval.getEndMillis()), UTC));
}

/**
Expand Down
@@ -1,6 +1,8 @@
package de.fraunhofer.iosb.ilt.sta.persistence.pgjooq.tables;

import de.fraunhofer.iosb.ilt.sta.persistence.pgjooq.PostGisGeometryBinding;
import java.time.OffsetDateTime;
import org.geolatte.geom.Geometry;
import org.jooq.Field;
import org.jooq.Name;
import org.jooq.Record;
Expand Down Expand Up @@ -72,14 +74,9 @@ public abstract class AbstractTableDatastreams<J> extends TableImpl<Record> impl
public final TableField<Record, String> name = createField("NAME", org.jooq.impl.SQLDataType.CLOB.defaultValue(org.jooq.impl.DSL.field("'no name'::text", org.jooq.impl.SQLDataType.CLOB)), this, "");

/**
* @deprecated Unknown data type. Please define an explicit
* {@link org.jooq.Binding} to specify how this type should be handled.
* Deprecation can be turned off using
* {@literal <deprecationOnUnknownTypes/>} in your code generator
* configuration.
* The column <code>public.DATASTREAMS.OBSERVED_AREA</code>.
*/
@java.lang.Deprecated
public final TableField<Record, Object> observedArea = createField("OBSERVED_AREA", org.jooq.impl.DefaultDataType.getDefaultDataType("\"public\".\"geometry\""), this, "");
public final TableField<Record, Geometry> observedArea = createField("OBSERVED_AREA", org.jooq.impl.DefaultDataType.getDefaultDataType("\"public\".\"geometry\""), this, "", new PostGisGeometryBinding());

/**
* A helper field for getting the observedArea
Expand Down
Expand Up @@ -22,43 +22,43 @@ public Class<Record> getRecordType() {

@Override
public TableField<Record, Long> getId() {
return ID;
return id;
}

@Override
public TableField<Record, Long> getSensorId() {
return SENSOR_ID;
return sensorId;
}

@Override
public TableField<Record, Long> getObsPropertyId() {
return OBS_PROPERTY_ID;
return ObsPropertyId;
}

@Override
public TableField<Record, Long> getThingId() {
return THING_ID;
return thingId;
}

/**
* The column <code>public.DATASTREAMS.ID</code>.
*/
public final TableField<Record, Long> ID = createField("ID", org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('\"DATASTREAMS_ID_seq\"'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, "");
public final TableField<Record, Long> id = createField("ID", org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('\"DATASTREAMS_ID_seq\"'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, "");

/**
* The column <code>public.DATASTREAMS.SENSOR_ID</code>.
*/
public final TableField<Record, Long> SENSOR_ID = createField("SENSOR_ID", org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, "");
public final TableField<Record, Long> sensorId = createField("SENSOR_ID", org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, "");

/**
* The column <code>public.DATASTREAMS.OBS_PROPERTY_ID</code>.
*/
public final TableField<Record, Long> OBS_PROPERTY_ID = createField("OBS_PROPERTY_ID", org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, "");
public final TableField<Record, Long> ObsPropertyId = createField("OBS_PROPERTY_ID", org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, "");

/**
* The column <code>public.DATASTREAMS.THING_ID</code>.
*/
public final TableField<Record, Long> THING_ID = createField("THING_ID", org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, "");
public final TableField<Record, Long> thingId = createField("THING_ID", org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, "");

/**
* Create a <code>public.DATASTREAMS</code> table reference
Expand Down
Expand Up @@ -22,13 +22,13 @@ public Class<Record> getRecordType() {

@Override
public TableField<Record, Long> getId() {
return ID;
return id;
}

/**
* The column <code>public.FEATURES.ID</code>.
*/
public final TableField<Record, Long> ID = createField("ID", org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('\"FEATURES_ID_seq\"'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, "");
public final TableField<Record, Long> id = createField("ID", org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('\"FEATURES_ID_seq\"'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, "");

/**
* Create a <code>public.FEATURES</code> table reference
Expand Down
@@ -1,7 +1,6 @@
package de.fraunhofer.iosb.ilt.sta.persistence.pgjooq.tables.longid;

import de.fraunhofer.iosb.ilt.sta.persistence.pgjooq.tables.AbstractTableHistLocations;
import java.time.OffsetDateTime;
import org.jooq.Name;
import org.jooq.Record;
import org.jooq.TableField;
Expand All @@ -23,28 +22,23 @@ public Class<Record> getRecordType() {

@Override
public TableField<Record, Long> getId() {
return ID;
return id;
}

@Override
public TableField<Record, Long> getThingId() {
return THING_ID;
return thingId;
}

/**
* The column <code>public.HIST_LOCATIONS.ID</code>.
*/
public final TableField<Record, Long> ID = createField("ID", org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('\"HIST_LOCATIONS_ID_seq\"'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, "");

/**
* The column <code>public.HIST_LOCATIONS.TIME</code>.
*/
public final TableField<Record, OffsetDateTime> time = createField("TIME", org.jooq.impl.SQLDataType.TIMESTAMPWITHTIMEZONE, this, "");
public final TableField<Record, Long> id = createField("ID", org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('\"HIST_LOCATIONS_ID_seq\"'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, "");

/**
* The column <code>public.HIST_LOCATIONS.THING_ID</code>.
*/
public final TableField<Record, Long> THING_ID = createField("THING_ID", org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, "");
public final TableField<Record, Long> thingId = createField("THING_ID", org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, "");

/**
* Create a <code>public.HIST_LOCATIONS</code> table reference
Expand Down
Expand Up @@ -25,7 +25,7 @@ public Class<Record> getRecordType() {

@Override
public TableField<Record, Long> getId() {
return ID;
return id;
}

@Override
Expand All @@ -36,7 +36,7 @@ public TableField<Record, Long> getGenFoiId() {
/**
* The column <code>public.LOCATIONS.ID</code>.
*/
public final TableField<Record, Long> ID = createField("ID", org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('\"LOCATIONS_ID_seq\"'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, "");
public final TableField<Record, Long> id = createField("ID", org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('\"LOCATIONS_ID_seq\"'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, "");

/**
* The column <code>public.LOCATIONS.GEN_FOI_ID</code>.
Expand Down
Expand Up @@ -25,23 +25,23 @@ public Class<Record> getRecordType() {

@Override
public TableField<Record, Long> getLocationId() {
return LOCATION_ID;
return locationId;
}

@Override
public TableField<Record, Long> getHistLocationId() {
return HIST_LOCATION_ID;
return histLocationId;
}

/**
* The column <code>public.LOCATIONS_HIST_LOCATIONS.LOCATION_ID</code>.
*/
public final TableField<Record, Long> LOCATION_ID = createField("LOCATION_ID", org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, "");
public final TableField<Record, Long> locationId = createField("LOCATION_ID", org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, "");

/**
* The column <code>public.LOCATIONS_HIST_LOCATIONS.HIST_LOCATION_ID</code>.
*/
public final TableField<Record, Long> HIST_LOCATION_ID = createField("HIST_LOCATION_ID", org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, "");
public final TableField<Record, Long> histLocationId = createField("HIST_LOCATION_ID", org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, "");

/**
* Create a <code>public.LOCATIONS_HIST_LOCATIONS</code> table reference
Expand Down
Expand Up @@ -25,33 +25,33 @@ public Class<Record> getRecordType() {

@Override
public TableField<Record, Long> getId() {
return ID;
return id;
}

@Override
public TableField<Record, Long> getSensorId() {
return SENSOR_ID;
return sensorId;
}

@Override
public TableField<Record, Long> getThingId() {
return THING_ID;
return thingId;
}

/**
* The column <code>public.MULTI_DATASTREAMS.ID</code>.
*/
public final TableField<Record, Long> ID = createField("ID", org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('\"MULTI_DATASTREAMS_ID_seq\"'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, "");
public final TableField<Record, Long> id = createField("ID", org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('\"MULTI_DATASTREAMS_ID_seq\"'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, "");

/**
* The column <code>public.MULTI_DATASTREAMS.SENSOR_ID</code>.
*/
public final TableField<Record, Long> SENSOR_ID = createField("SENSOR_ID", org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, "");
public final TableField<Record, Long> sensorId = createField("SENSOR_ID", org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, "");

/**
* The column <code>public.MULTI_DATASTREAMS.THING_ID</code>.
*/
public final TableField<Record, Long> THING_ID = createField("THING_ID", org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, "");
public final TableField<Record, Long> thingId = createField("THING_ID", org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, "");

/**
* Create a <code>public.MULTI_DATASTREAMS</code> table reference
Expand Down
Expand Up @@ -26,25 +26,25 @@ public Class<Record> getRecordType() {

@Override
public TableField<Record, Long> getMultiDatastreamId() {
return MULTI_DATASTREAM_ID;
return multiDatastreamId;
}

@Override
public TableField<Record, Long> getObsPropertyId() {
return OBS_PROPERTY_ID;
return ObsPropertyId;
}

/**
* The column
* <code>public.MULTI_DATASTREAMS_OBS_PROPERTIES.MULTI_DATASTREAM_ID</code>.
*/
public final TableField<Record, Long> MULTI_DATASTREAM_ID = createField("MULTI_DATASTREAM_ID", org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, "");
public final TableField<Record, Long> multiDatastreamId = createField("MULTI_DATASTREAM_ID", org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, "");

/**
* The column
* <code>public.MULTI_DATASTREAMS_OBS_PROPERTIES.OBS_PROPERTY_ID</code>.
*/
public final TableField<Record, Long> OBS_PROPERTY_ID = createField("OBS_PROPERTY_ID", org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, "");
public final TableField<Record, Long> ObsPropertyId = createField("OBS_PROPERTY_ID", org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, "");

/**
* Create a <code>public.MULTI_DATASTREAMS_OBS_PROPERTIES</code> table
Expand Down
Expand Up @@ -25,13 +25,13 @@ public Class<Record> getRecordType() {

@Override
public TableField<Record, Long> getId() {
return ID;
return id;
}

/**
* The column <code>public.OBS_PROPERTIES.ID</code>.
*/
public final TableField<Record, Long> ID = createField("ID", org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('\"OBS_PROPERTIES_ID_seq\"'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, "");
public final TableField<Record, Long> id = createField("ID", org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('\"OBS_PROPERTIES_ID_seq\"'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, "");

/**
* Create a <code>public.OBS_PROPERTIES</code> table reference
Expand Down
Expand Up @@ -25,43 +25,43 @@ public Class<Record> getRecordType() {

@Override
public TableField<Record, Long> getId() {
return ID;
return id;
}

@Override
public TableField<Record, Long> getDatastreamId() {
return DATASTREAM_ID;
return datastreamId;
}

@Override
public TableField<Record, Long> getFeatureId() {
return FEATURE_ID;
return featureId;
}

@Override
public TableField<Record, Long> getMultiDatastreamId() {
return MULTI_DATASTREAM_ID;
return multiDatastreamId;
}

/**
* The column <code>public.OBSERVATIONS.ID</code>.
*/
public final TableField<Record, Long> ID = createField("ID", org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('\"OBSERVATIONS_ID_seq\"'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, "");
public final TableField<Record, Long> id = createField("ID", org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('\"OBSERVATIONS_ID_seq\"'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, "");

/**
* The column <code>public.OBSERVATIONS.DATASTREAM_ID</code>.
*/
public final TableField<Record, Long> DATASTREAM_ID = createField("DATASTREAM_ID", org.jooq.impl.SQLDataType.BIGINT, this, "");
public final TableField<Record, Long> datastreamId = createField("DATASTREAM_ID", org.jooq.impl.SQLDataType.BIGINT, this, "");

/**
* The column <code>public.OBSERVATIONS.FEATURE_ID</code>.
*/
public final TableField<Record, Long> FEATURE_ID = createField("FEATURE_ID", org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, "");
public final TableField<Record, Long> featureId = createField("FEATURE_ID", org.jooq.impl.SQLDataType.BIGINT.nullable(false), this, "");

/**
* The column <code>public.OBSERVATIONS.MULTI_DATASTREAM_ID</code>.
*/
public final TableField<Record, Long> MULTI_DATASTREAM_ID = createField("MULTI_DATASTREAM_ID", org.jooq.impl.SQLDataType.BIGINT, this, "");
public final TableField<Record, Long> multiDatastreamId = createField("MULTI_DATASTREAM_ID", org.jooq.impl.SQLDataType.BIGINT, this, "");

/**
* Create a <code>public.OBSERVATIONS</code> table reference
Expand Down
Expand Up @@ -25,13 +25,13 @@ public Class<Record> getRecordType() {

@Override
public TableField<Record, Long> getId() {
return ID;
return id;
}

/**
* The column <code>public.SENSORS.ID</code>.
*/
public final TableField<Record, Long> ID = createField("ID", org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('\"SENSORS_ID_seq\"'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, "");
public final TableField<Record, Long> id = createField("ID", org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('\"SENSORS_ID_seq\"'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, "");

/**
* Create a <code>public.SENSORS</code> table reference
Expand Down
Expand Up @@ -25,13 +25,13 @@ public Class<Record> getRecordType() {

@Override
public TableField<Record, Long> getId() {
return ID;
return id;
}

/**
* The column <code>public.THINGS.ID</code>.
*/
public final TableField<Record, Long> ID = createField("ID", org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('\"THINGS_ID_seq\"'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, "");
public final TableField<Record, Long> id = createField("ID", org.jooq.impl.SQLDataType.BIGINT.nullable(false).defaultValue(org.jooq.impl.DSL.field("nextval('\"THINGS_ID_seq\"'::regclass)", org.jooq.impl.SQLDataType.BIGINT)), this, "");

/**
* Create a <code>public.THINGS</code> table reference
Expand Down

0 comments on commit 37574b4

Please sign in to comment.