From d42e86f28502969c889ad81277c44881fd8d4d8e Mon Sep 17 00:00:00 2001 From: Anthonin LIZE Date: Thu, 2 Jun 2022 10:51:53 +0200 Subject: [PATCH] Updating MapTypeNetwork in ORM --- .../org/oceanops/api/orm/auto/_MapType.java | 19 ------- .../api/orm/auto/_MapTypeNetwork.java | 50 ++++++------------ .../orm/auto/_PtfAncillaryDeviceVersion.java | 52 +++++-------------- src/main/resources/OceanOPS-API.graph.xml | 8 +-- src/main/resources/datamap.map.xml | 16 +++--- src/main/resources/oceanops-api.yaml | 6 +-- 6 files changed, 40 insertions(+), 111 deletions(-) diff --git a/src/main/java/org/oceanops/api/orm/auto/_MapType.java b/src/main/java/org/oceanops/api/orm/auto/_MapType.java index c54b14f..4f50196 100644 --- a/src/main/java/org/oceanops/api/orm/auto/_MapType.java +++ b/src/main/java/org/oceanops/api/orm/auto/_MapType.java @@ -29,7 +29,6 @@ public abstract class _MapType extends BaseDataObject { public static final StringProperty NAME = PropertyFactory.createString("name", String.class); public static final StringProperty NAME_LONG = PropertyFactory.createString("nameLong", String.class); public static final StringProperty NAME_SHORT = PropertyFactory.createString("nameShort", String.class); - public static final NumericProperty RANK = PropertyFactory.createNumeric("rank", Integer.class); public static final ListProperty MAP_TYPE_NETWORKS = PropertyFactory.createList("mapTypeNetworks", MapTypeNetwork.class); protected Integer freq; @@ -37,7 +36,6 @@ public abstract class _MapType extends BaseDataObject { protected String name; protected String nameLong; protected String nameShort; - protected Integer rank; protected Object mapTypeNetworks; @@ -91,16 +89,6 @@ public String getNameShort() { return this.nameShort; } - public void setRank(Integer rank) { - beforePropertyWrite("rank", this.rank, rank); - this.rank = rank; - } - - public Integer getRank() { - beforePropertyRead("rank"); - return this.rank; - } - public void addToMapTypeNetworks(MapTypeNetwork obj) { addToManyTarget("mapTypeNetworks", obj, true); } @@ -131,8 +119,6 @@ public Object readPropertyDirectly(String propName) { return this.nameLong; case "nameShort": return this.nameShort; - case "rank": - return this.rank; case "mapTypeNetworks": return this.mapTypeNetworks; default: @@ -162,9 +148,6 @@ public void writePropertyDirectly(String propName, Object val) { case "nameShort": this.nameShort = (String)val; break; - case "rank": - this.rank = (Integer)val; - break; case "mapTypeNetworks": this.mapTypeNetworks = val; break; @@ -189,7 +172,6 @@ protected void writeState(ObjectOutputStream out) throws IOException { out.writeObject(this.name); out.writeObject(this.nameLong); out.writeObject(this.nameShort); - out.writeObject(this.rank); out.writeObject(this.mapTypeNetworks); } @@ -201,7 +183,6 @@ protected void readState(ObjectInputStream in) throws IOException, ClassNotFound this.name = (String)in.readObject(); this.nameLong = (String)in.readObject(); this.nameShort = (String)in.readObject(); - this.rank = (Integer)in.readObject(); this.mapTypeNetworks = in.readObject(); } diff --git a/src/main/java/org/oceanops/api/orm/auto/_MapTypeNetwork.java b/src/main/java/org/oceanops/api/orm/auto/_MapTypeNetwork.java index 7cc3b79..4b9cea8 100644 --- a/src/main/java/org/oceanops/api/orm/auto/_MapTypeNetwork.java +++ b/src/main/java/org/oceanops/api/orm/auto/_MapTypeNetwork.java @@ -21,38 +21,25 @@ public abstract class _MapTypeNetwork extends BaseDataObject { private static final long serialVersionUID = 1L; - public static final String MAP_TYPE_ID_PK_COLUMN = "MAP_TYPE_ID"; - public static final String NETWORK_ID_PK_COLUMN = "NETWORK_ID"; + public static final String ID_PK_COLUMN = "ID"; - public static final NumericProperty MAP_TYPE_ID = PropertyFactory.createNumeric("mapTypeId", Integer.class); - public static final NumericProperty NETWORK_ID = PropertyFactory.createNumeric("networkId", Integer.class); + public static final NumericProperty RANK = PropertyFactory.createNumeric("rank", Integer.class); public static final EntityProperty MAP_TYPE = PropertyFactory.createEntity("mapType", MapType.class); public static final EntityProperty NETWORK = PropertyFactory.createEntity("network", Network.class); - protected Integer mapTypeId; - protected Integer networkId; + protected Integer rank; protected Object mapType; protected Object network; - public void setMapTypeId(Integer mapTypeId) { - beforePropertyWrite("mapTypeId", this.mapTypeId, mapTypeId); - this.mapTypeId = mapTypeId; + public void setRank(Integer rank) { + beforePropertyWrite("rank", this.rank, rank); + this.rank = rank; } - public Integer getMapTypeId() { - beforePropertyRead("mapTypeId"); - return this.mapTypeId; - } - - public void setNetworkId(Integer networkId) { - beforePropertyWrite("networkId", this.networkId, networkId); - this.networkId = networkId; - } - - public Integer getNetworkId() { - beforePropertyRead("networkId"); - return this.networkId; + public Integer getRank() { + beforePropertyRead("rank"); + return this.rank; } public void setMapType(MapType mapType) { @@ -78,10 +65,8 @@ public Object readPropertyDirectly(String propName) { } switch(propName) { - case "mapTypeId": - return this.mapTypeId; - case "networkId": - return this.networkId; + case "rank": + return this.rank; case "mapType": return this.mapType; case "network": @@ -98,11 +83,8 @@ public void writePropertyDirectly(String propName, Object val) { } switch (propName) { - case "mapTypeId": - this.mapTypeId = (Integer)val; - break; - case "networkId": - this.networkId = (Integer)val; + case "rank": + this.rank = (Integer)val; break; case "mapType": this.mapType = val; @@ -126,8 +108,7 @@ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundE @Override protected void writeState(ObjectOutputStream out) throws IOException { super.writeState(out); - out.writeObject(this.mapTypeId); - out.writeObject(this.networkId); + out.writeObject(this.rank); out.writeObject(this.mapType); out.writeObject(this.network); } @@ -135,8 +116,7 @@ protected void writeState(ObjectOutputStream out) throws IOException { @Override protected void readState(ObjectInputStream in) throws IOException, ClassNotFoundException { super.readState(in); - this.mapTypeId = (Integer)in.readObject(); - this.networkId = (Integer)in.readObject(); + this.rank = (Integer)in.readObject(); this.mapType = in.readObject(); this.network = in.readObject(); } diff --git a/src/main/java/org/oceanops/api/orm/auto/_PtfAncillaryDeviceVersion.java b/src/main/java/org/oceanops/api/orm/auto/_PtfAncillaryDeviceVersion.java index 9777850..b641d45 100644 --- a/src/main/java/org/oceanops/api/orm/auto/_PtfAncillaryDeviceVersion.java +++ b/src/main/java/org/oceanops/api/orm/auto/_PtfAncillaryDeviceVersion.java @@ -3,14 +3,12 @@ import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; -import java.util.List; import org.apache.cayenne.BaseDataObject; import org.apache.cayenne.exp.property.EntityProperty; -import org.apache.cayenne.exp.property.ListProperty; import org.apache.cayenne.exp.property.PropertyFactory; import org.apache.cayenne.exp.property.StringProperty; -import org.oceanops.api.orm.PtfAncillaryDevice; +import org.oceanops.api.orm.PtfAncillaryDeviceName; import org.oceanops.api.orm.PtfModel; /** @@ -25,27 +23,15 @@ public abstract class _PtfAncillaryDeviceVersion extends BaseDataObject { public static final String ID_PK_COLUMN = "ID"; - public static final StringProperty DEVICE_NAME = PropertyFactory.createString("deviceName", String.class); public static final StringProperty VERSION = PropertyFactory.createString("version", String.class); - public static final ListProperty PTF_ANCILLARY_DEVICE = PropertyFactory.createList("ptfAncillaryDevice", PtfAncillaryDevice.class); + public static final EntityProperty PTF_ANCILLARY_DEVICE_NAME = PropertyFactory.createEntity("ptfAncillaryDeviceName", PtfAncillaryDeviceName.class); public static final EntityProperty PTF_MODEL = PropertyFactory.createEntity("ptfModel", PtfModel.class); - protected String deviceName; protected String version; - protected Object ptfAncillaryDevice; + protected Object ptfAncillaryDeviceName; protected Object ptfModel; - public void setDeviceName(String deviceName) { - beforePropertyWrite("deviceName", this.deviceName, deviceName); - this.deviceName = deviceName; - } - - public String getDeviceName() { - beforePropertyRead("deviceName"); - return this.deviceName; - } - public void setVersion(String version) { beforePropertyWrite("version", this.version, version); this.version = version; @@ -56,17 +42,12 @@ public String getVersion() { return this.version; } - public void addToPtfAncillaryDevice(PtfAncillaryDevice obj) { - addToManyTarget("ptfAncillaryDevice", obj, true); + public void setPtfAncillaryDeviceName(PtfAncillaryDeviceName ptfAncillaryDeviceName) { + setToOneTarget("ptfAncillaryDeviceName", ptfAncillaryDeviceName, true); } - public void removeFromPtfAncillaryDevice(PtfAncillaryDevice obj) { - removeToManyTarget("ptfAncillaryDevice", obj, true); - } - - @SuppressWarnings("unchecked") - public List getPtfAncillaryDevice() { - return (List)readProperty("ptfAncillaryDevice"); + public PtfAncillaryDeviceName getPtfAncillaryDeviceName() { + return (PtfAncillaryDeviceName)readProperty("ptfAncillaryDeviceName"); } public void setPtfModel(PtfModel ptfModel) { @@ -84,12 +65,10 @@ public Object readPropertyDirectly(String propName) { } switch(propName) { - case "deviceName": - return this.deviceName; case "version": return this.version; - case "ptfAncillaryDevice": - return this.ptfAncillaryDevice; + case "ptfAncillaryDeviceName": + return this.ptfAncillaryDeviceName; case "ptfModel": return this.ptfModel; default: @@ -104,14 +83,11 @@ public void writePropertyDirectly(String propName, Object val) { } switch (propName) { - case "deviceName": - this.deviceName = (String)val; - break; case "version": this.version = (String)val; break; - case "ptfAncillaryDevice": - this.ptfAncillaryDevice = val; + case "ptfAncillaryDeviceName": + this.ptfAncillaryDeviceName = val; break; case "ptfModel": this.ptfModel = val; @@ -132,18 +108,16 @@ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundE @Override protected void writeState(ObjectOutputStream out) throws IOException { super.writeState(out); - out.writeObject(this.deviceName); out.writeObject(this.version); - out.writeObject(this.ptfAncillaryDevice); + out.writeObject(this.ptfAncillaryDeviceName); out.writeObject(this.ptfModel); } @Override protected void readState(ObjectInputStream in) throws IOException, ClassNotFoundException { super.readState(in); - this.deviceName = (String)in.readObject(); this.version = (String)in.readObject(); - this.ptfAncillaryDevice = in.readObject(); + this.ptfAncillaryDeviceName = in.readObject(); this.ptfModel = in.readObject(); } diff --git a/src/main/resources/OceanOPS-API.graph.xml b/src/main/resources/OceanOPS-API.graph.xml index ffd4ef5..4d947a0 100644 --- a/src/main/resources/OceanOPS-API.graph.xml +++ b/src/main/resources/OceanOPS-API.graph.xml @@ -110,7 +110,7 @@ - + @@ -154,7 +154,7 @@ - + @@ -326,7 +326,7 @@ - + @@ -384,7 +384,7 @@ - + diff --git a/src/main/resources/datamap.map.xml b/src/main/resources/datamap.map.xml index 1b178b8..159c60c 100644 --- a/src/main/resources/datamap.map.xml +++ b/src/main/resources/datamap.map.xml @@ -581,11 +581,12 @@ - - - + + + + @@ -2312,11 +2313,9 @@ - - - + @@ -4003,7 +4002,7 @@ - + @@ -4087,7 +4086,7 @@ - + @@ -6014,7 +6013,6 @@ true - PtfAncillaryDeviceName,PtfAncillaryDeviceVersion ..\java all diff --git a/src/main/resources/oceanops-api.yaml b/src/main/resources/oceanops-api.yaml index 5c9d4f5..a68854b 100644 --- a/src/main/resources/oceanops-api.yaml +++ b/src/main/resources/oceanops-api.yaml @@ -1193,18 +1193,14 @@ components: type: string nameShort: type: string - rank: - type: number type: object MapTypeNetwork: properties: mapType: $ref: '#/components/schemas/MapType' - mapTypeId: - type: number network: $ref: '#/components/schemas/Network' - networkId: + rank: type: number type: object MzmsPtfCountry: