Skip to content

Commit

Permalink
Updating MapTypeNetwork in ORM
Browse files Browse the repository at this point in the history
  • Loading branch information
Anthonin LIZE committed Jun 2, 2022
1 parent ad375ce commit d42e86f
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 111 deletions.
19 changes: 0 additions & 19 deletions src/main/java/org/oceanops/api/orm/auto/_MapType.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,13 @@ public abstract class _MapType extends BaseDataObject {
public static final StringProperty<String> NAME = PropertyFactory.createString("name", String.class);
public static final StringProperty<String> NAME_LONG = PropertyFactory.createString("nameLong", String.class);
public static final StringProperty<String> NAME_SHORT = PropertyFactory.createString("nameShort", String.class);
public static final NumericProperty<Integer> RANK = PropertyFactory.createNumeric("rank", Integer.class);
public static final ListProperty<MapTypeNetwork> MAP_TYPE_NETWORKS = PropertyFactory.createList("mapTypeNetworks", MapTypeNetwork.class);

protected Integer freq;
protected Integer id;
protected String name;
protected String nameLong;
protected String nameShort;
protected Integer rank;

protected Object mapTypeNetworks;

Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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;
Expand All @@ -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);
}

Expand All @@ -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();
}

Expand Down
50 changes: 15 additions & 35 deletions src/main/java/org/oceanops/api/orm/auto/_MapTypeNetwork.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<Integer> MAP_TYPE_ID = PropertyFactory.createNumeric("mapTypeId", Integer.class);
public static final NumericProperty<Integer> NETWORK_ID = PropertyFactory.createNumeric("networkId", Integer.class);
public static final NumericProperty<Integer> RANK = PropertyFactory.createNumeric("rank", Integer.class);
public static final EntityProperty<MapType> MAP_TYPE = PropertyFactory.createEntity("mapType", MapType.class);
public static final EntityProperty<Network> 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) {
Expand All @@ -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":
Expand All @@ -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;
Expand All @@ -126,17 +108,15 @@ 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);
}

@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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand All @@ -25,27 +23,15 @@ public abstract class _PtfAncillaryDeviceVersion extends BaseDataObject {

public static final String ID_PK_COLUMN = "ID";

public static final StringProperty<String> DEVICE_NAME = PropertyFactory.createString("deviceName", String.class);
public static final StringProperty<String> VERSION = PropertyFactory.createString("version", String.class);
public static final ListProperty<PtfAncillaryDevice> PTF_ANCILLARY_DEVICE = PropertyFactory.createList("ptfAncillaryDevice", PtfAncillaryDevice.class);
public static final EntityProperty<PtfAncillaryDeviceName> PTF_ANCILLARY_DEVICE_NAME = PropertyFactory.createEntity("ptfAncillaryDeviceName", PtfAncillaryDeviceName.class);
public static final EntityProperty<PtfModel> 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;
Expand All @@ -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<PtfAncillaryDevice> getPtfAncillaryDevice() {
return (List<PtfAncillaryDevice>)readProperty("ptfAncillaryDevice");
public PtfAncillaryDeviceName getPtfAncillaryDeviceName() {
return (PtfAncillaryDeviceName)readProperty("ptfAncillaryDeviceName");
}

public void setPtfModel(PtfModel ptfModel) {
Expand All @@ -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:
Expand All @@ -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;
Expand All @@ -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();
}

Expand Down
8 changes: 4 additions & 4 deletions src/main/resources/OceanOPS-API.graph.xml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
<entity name="UserGroupAgency" x="10.0" y="10.0" width="104.0" height="66.0"/>
<entity name="Weblink" x="10.0" y="10.0" width="61.0" height="130.0"/>
<entity name="Image" x="10.0" y="10.0" width="69.0" height="210.0"/>
<entity name="MapTypeNetwork" x="10.0" y="10.0" width="103.0" height="66.0"/>
<entity name="MapTypeNetwork" x="10.0" y="10.0" width="103.0" height="50.0"/>
<entity name="UserGroup" x="10.0" y="10.0" width="63.0" height="114.0"/>
<entity name="LocSystem" x="10.0" y="10.0" width="62.0" height="98.0"/>
<entity name="PtfPtfStatus" x="10.0" y="10.0" width="76.0" height="82.0"/>
Expand Down Expand Up @@ -154,7 +154,7 @@
<entity name="ObsLatest" x="10.0" y="10.0" width="61.0" height="130.0"/>
<entity name="Retrieval" x="10.0" y="10.0" width="90.0" height="242.0"/>
<entity name="DacType" x="10.0" y="10.0" width="61.0" height="98.0"/>
<entity name="MapType" x="10.0" y="10.0" width="60.0" height="130.0"/>
<entity name="MapType" x="10.0" y="10.0" width="60.0" height="114.0"/>
<entity name="ShipHistory" x="10.0" y="10.0" width="66.0" height="210.0"/>
<entity name="ContactPtfRole" x="10.0" y="10.0" width="87.0" height="50.0"/>
<entity name="AgencySiteRole" x="10.0" y="10.0" width="90.0" height="66.0"/>
Expand Down Expand Up @@ -326,7 +326,7 @@
<entity name="SENSOR_FAMILY" x="2168.86" y="1489.04" width="95.0" height="82.0"/>
<entity name="LINE_SURVEY" x="1715.07" y="1628.5" width="131.0" height="114.0"/>
<entity name="DATA_FORMAT" x="2088.99" y="1413.06" width="88.0" height="98.0"/>
<entity name="MAP_TYPE" x="2260.78" y="1651.29" width="78.0" height="130.0"/>
<entity name="MAP_TYPE" x="2260.78" y="1651.29" width="78.0" height="114.0"/>
<entity name="TELECOM_FORMAT" x="1884.44" y="1650.39" width="108.0" height="226.0"/>
<entity name="AGENCY_PTF" x="2071.13" y="1597.23" width="106.0" height="130.0"/>
<entity name="CRUISE_STATUS" x="2227.69" y="1731.18" width="93.0" height="114.0"/>
Expand Down Expand Up @@ -384,7 +384,7 @@
<entity name="CONTACT_SITE_ROLE" x="184.7" y="951.45" width="119.0" height="98.0"/>
<entity name="LINE" x="1151.11" y="649.14" width="144.0" height="146.0"/>
<entity name="BASIN" x="327.91" y="602.59" width="82.0" height="178.0"/>
<entity name="MAP_TYPE_NETWORK" x="804.69" y="1498.5" width="124.0" height="66.0"/>
<entity name="MAP_TYPE_NETWORK" x="804.69" y="1498.5" width="124.0" height="98.0"/>
<entity name="WEB_PTF_FILTER" x="2233.0" y="1755.0" width="95.0" height="98.0"/>
<entity name="PTF_LOC_STATUS" x="525.84" y="989.8" width="99.0" height="114.0"/>
<entity name="OBS_ARGO_GDAC" x="789.73" y="996.87" width="163.0" height="418.0"/>
Expand Down
16 changes: 7 additions & 9 deletions src/main/resources/datamap.map.xml
Original file line number Diff line number Diff line change
Expand Up @@ -581,11 +581,12 @@
<db-attribute name="NAME" type="VARCHAR" length="50"/>
<db-attribute name="NAME_LONG" type="VARCHAR" length="80"/>
<db-attribute name="NAME_SHORT" type="VARCHAR" length="30"/>
<db-attribute name="RANK" type="NUMERIC" length="38"/>
</db-entity>
<db-entity name="MAP_TYPE_NETWORK" schema="JCOMMOPS_B">
<db-attribute name="MAP_TYPE_ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
<db-attribute name="NETWORK_ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
<db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true" length="10"/>
<db-attribute name="MAP_TYPE_ID" type="INTEGER" isMandatory="true" length="10"/>
<db-attribute name="NETWORK_ID" type="INTEGER" isMandatory="true" length="10"/>
<db-attribute name="RANK" type="INTEGER" length="10"/>
</db-entity>
<db-entity name="MEETING" schema="JCOMMOPS_B">
<db-attribute name="CONTACT_ID" type="INTEGER" isMandatory="true" length="10"/>
Expand Down Expand Up @@ -2312,11 +2313,9 @@
<obj-attribute name="name" type="java.lang.String" db-attribute-path="NAME"/>
<obj-attribute name="nameLong" type="java.lang.String" db-attribute-path="NAME_LONG"/>
<obj-attribute name="nameShort" type="java.lang.String" db-attribute-path="NAME_SHORT"/>
<obj-attribute name="rank" type="java.lang.Integer" db-attribute-path="RANK"/>
</obj-entity>
<obj-entity name="MapTypeNetwork" className="org.oceanops.api.orm.MapTypeNetwork" dbEntityName="MAP_TYPE_NETWORK">
<obj-attribute name="mapTypeId" type="java.lang.Integer" db-attribute-path="MAP_TYPE_ID"/>
<obj-attribute name="networkId" type="java.lang.Integer" db-attribute-path="NETWORK_ID"/>
<obj-attribute name="rank" type="java.lang.Integer" db-attribute-path="RANK"/>
</obj-entity>
<obj-entity name="Meeting" className="org.oceanops.api.orm.Meeting" dbEntityName="MEETING">
<obj-attribute name="description" type="java.lang.String" db-attribute-path="DESCRIPTION"/>
Expand Down Expand Up @@ -4003,7 +4002,7 @@
<db-relationship name="ptfs1" source="LOC_SYSTEM" target="PTF" toMany="true">
<db-attribute-pair source="ID" target="TRACKING_SYSTEM_ID"/>
</db-relationship>
<db-relationship name="mapTypeNetworks" source="MAP_TYPE" target="MAP_TYPE_NETWORK" toDependentPK="true" toMany="true">
<db-relationship name="mapTypeNetworks" source="MAP_TYPE" target="MAP_TYPE_NETWORK" toMany="true">
<db-attribute-pair source="ID" target="MAP_TYPE_ID"/>
</db-relationship>
<db-relationship name="mapType" source="MAP_TYPE_NETWORK" target="MAP_TYPE">
Expand Down Expand Up @@ -4087,7 +4086,7 @@
<db-relationship name="indicators1" source="NETWORK" target="INDICATOR" toMany="true">
<db-attribute-pair source="ID" target="MASTER_NETWORK_ID"/>
</db-relationship>
<db-relationship name="mapTypeNetworks" source="NETWORK" target="MAP_TYPE_NETWORK" toDependentPK="true" toMany="true">
<db-relationship name="mapTypeNetworks" source="NETWORK" target="MAP_TYPE_NETWORK" toMany="true">
<db-attribute-pair source="ID" target="NETWORK_ID"/>
</db-relationship>
<db-relationship name="networkContacts" source="NETWORK" target="NETWORK_CONTACT" toDependentPK="true" toMany="true">
Expand Down Expand Up @@ -6014,7 +6013,6 @@
<usePrimitives>true</usePrimitives>
</dbImport>
<cgen xmlns="http://cayenne.apache.org/schema/10/cgen">
<excludeEntities>PtfAncillaryDeviceName,PtfAncillaryDeviceVersion</excludeEntities>
<destDir>..\java</destDir>
<mode>all</mode>
<template>templates/v4_1/subclass.vm</template>
Expand Down
6 changes: 1 addition & 5 deletions src/main/resources/oceanops-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit d42e86f

Please sign in to comment.