modified some things

This commit is contained in:
2021-11-18 12:42:06 +01:00
parent 7c3916a6ce
commit f04b77bc09
25 changed files with 61 additions and 160 deletions

10
pom.xml
View File

@@ -9,6 +9,7 @@
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
<properties> <properties>
<maven.compiler.release>17</maven.compiler.release>
<maven.compiler.source>17</maven.compiler.source> <maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target> <maven.compiler.target>17</maven.compiler.target>
</properties> </properties>
@@ -107,7 +108,14 @@
<source>${basedir}/src/main/resources/material.xsd</source> <source>${basedir}/src/main/resources/material.xsd</source>
</sources> </sources>
</configuration> </configuration>
</plugin> </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<release>7</release>
</configuration>
</plugin>
</plugins> </plugins>
</build> </build>

View File

@@ -28,13 +28,10 @@ public class DAO {
} }
public void getId(Exchange exchange) throws InterruptedException { public void getId(Exchange exchange) throws InterruptedException {
MaterialType tmp = (MaterialType) exchange.getIn().getBody(); MaterialType tmp = (MaterialType) exchange.getIn().getBody();
System.out.println(tmp.getDescription()+tmp.getMaterialName()); System.out.println(tmp.getDescription() + tmp.getMaterialName());
Thread.sleep(10000); Thread.sleep(10000);
exchange.getIn().setBody("SELECT * FROM package WHERE material_id = 1"); exchange.getIn().setBody("SELECT * FROM package WHERE material_id = 1");
} }
@@ -43,26 +40,20 @@ public class DAO {
HashMap map = (HashMap) exchange.getIn().getBody(); HashMap map = (HashMap) exchange.getIn().getBody();
MaterialType materialType = new MaterialType(); MaterialType materialType = new MaterialType();
materialType.setMaterialType(map.get("")); materialType.setId((Integer) map.get("id"));
materialType.setMaterialNumber((String) map.get("number"));
materialType.getMaterialType();
materialType.setMaterialName();
materialType.setDescription();
materialType.setIsDeleted();
System.out.println(tmp.getDescription()+tmp.getMaterialName());
// System.out.println(tmp.getDescription()+tmp.getMaterialName());
Thread.sleep(10000); Thread.sleep(10000);
exchange.getIn().setBody("SELECT * FROM package WHERE material_id = 1"); exchange.getIn().setBody("SELECT * FROM package WHERE material_id = 1");
} }
public void splitPackage(LinkedHashMap packageMap) { public void splitPackage(LinkedHashMap packageMap) {
Package pack = new Package(); Package pack = new Package();
pack.setId((Integer) packageMap.get("id")); pack.setId((Integer) packageMap.get("id"));

View File

@@ -30,7 +30,7 @@
<xs:complexType name="materialType"> <xs:complexType name="materialType">
<xs:sequence> <xs:sequence>
<xs:element name="id" type="xs:int"/> <xs:element name="id" type="xs:int"/>
<xs:element name="material_number" type="xs:int"/> <xs:element name="material_number" type="xs:string"/>
<xs:element name="material_type" type="material_typeType"/> <xs:element name="material_type" type="material_typeType"/>
<xs:element name="material_name" type="xs:string"/> <xs:element name="material_name" type="xs:string"/>
<xs:element name="description" type="xs:string"/> <xs:element name="description" type="xs:string"/>

View File

@@ -1,26 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<jaxb:bindings version="2.1" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb">
<!--
This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.2
See <a href="https://javaee.github.io/jaxb-v2/">https://javaee.github.io/jaxb-v2/</a>
Any modifications to this file will be lost upon recompilation of the source schema.
Generated on: 2021.11.17 at 01:26:11 PM CET
-->
<jaxb:bindings scd="x-schema::">
<jaxb:schemaBindings map="false">
<jaxb:package name="generated"/>
</jaxb:schemaBindings>
<jaxb:bindings scd="~materialType">
<jaxb:class ref="generated.MaterialType"/>
</jaxb:bindings>
<jaxb:bindings scd="~package">
<jaxb:class ref="generated.Package"/>
</jaxb:bindings>
<jaxb:bindings scd="~material_typeType">
<jaxb:typesafeEnumClass ref="generated.MaterialTypeType"/>
</jaxb:bindings>
</jaxb:bindings>
</jaxb:bindings>

View File

@@ -1,20 +0,0 @@
<material>
<material_number>7</material_number>
<material_type>A1</material_type>
<material_name>LEGO 17272</material_name>
<description>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</description>
<is_deleted>false</is_deleted>
<packages>
<package_number>11988</package_number>
<ean>80975098498590834</ean>
<unit_of_measure>pcs</unit_of_measure>
<dimension>17x17x17</dimension>
<description>Lorem ipsum dolor sit amet, consectetur adipiscing elit</description>
</packages>
<packages>
<package_number>118</package_number>
<ean>877854875843774</ean>
<unit_of_measure>pcs</unit_of_measure>
<dimension>20x20x20</dimension>
</packages>
</material>

View File

@@ -1,45 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:complexType name="package">
<xs:sequence>
<xs:element name="id" type="xs:int"/>
<xs:element name="material_id" type="xs:int"/>
<xs:element name="package_number" type="xs:int"/>
<xs:element name="ean" type="xs:string"/>
<xs:element name="unit_of_measure" type="xs:string"/>
<xs:element name="dimension" type="xs:string"/>
<xs:element name="description" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="material_typeType" final="restriction">
<xs:restriction base="xs:string">
<xs:enumeration value="A1"/>
<xs:enumeration value="A2"/>
<xs:enumeration value="A3"/>
<xs:enumeration value="B1"/>
<xs:enumeration value="B2"/>
<xs:enumeration value="B3"/>
<xs:enumeration value="Z1"/>
<xs:enumeration value="Z2"/>
<xs:enumeration value="Z3"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="materialType">
<xs:sequence>
<xs:element name="id" type="xs:int"/>
<xs:element name="material_number" type="xs:int"/>
<xs:element name="material_type" type="material_typeType"/>
<xs:element name="material_name" type="xs:string"/>
<xs:element name="description" type="xs:string"/>
<xs:element name="is_deleted" type="xs:boolean"/>
<xs:element name="packages" type="package" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:element name="material" type="materialType"/>
</xs:schema>

View File

@@ -1,15 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<material>
<material_number>number8186</material_number>
<material_type>Z3</material_type>
<material_name>name2686</material_name>
<description>description7225</description>
<is_deleted>true</is_deleted>
<packages>
<package_number>number2274</package_number>
<ean>5903339152912</ean>
<unit_of_measure>unit1350</unit_of_measure>
<dimension>18x30x18</dimension>
<description>description7460</description>
</packages>
</material>

View File

@@ -5,7 +5,7 @@
This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.2 This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.2
See <a href="https://javaee.github.io/jaxb-v2/">https://javaee.github.io/jaxb-v2/</a> See <a href="https://javaee.github.io/jaxb-v2/">https://javaee.github.io/jaxb-v2/</a>
Any modifications to this file will be lost upon recompilation of the source schema. Any modifications to this file will be lost upon recompilation of the source schema.
Generated on: 2021.11.17 at 01:26:11 PM CET Generated on: 2021.11.18 at 12:37:46 PM CET
--> -->
<jaxb:bindings scd="x-schema::"> <jaxb:bindings scd="x-schema::">

View File

@@ -2,7 +2,7 @@
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.2
// See <a href="https://javaee.github.io/jaxb-v2/">https://javaee.github.io/jaxb-v2/</a> // See <a href="https://javaee.github.io/jaxb-v2/">https://javaee.github.io/jaxb-v2/</a>
// Any modifications to this file will be lost upon recompilation of the source schema. // Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2021.11.17 at 01:26:11 PM CET // Generated on: 2021.11.18 at 12:37:46 PM CET
// //
@@ -28,7 +28,7 @@ import javax.xml.bind.annotation.XmlType;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence&gt; * &lt;sequence&gt;
* &lt;element name="id" type="{http://www.w3.org/2001/XMLSchema}int"/&gt; * &lt;element name="id" type="{http://www.w3.org/2001/XMLSchema}int"/&gt;
* &lt;element name="material_number" type="{http://www.w3.org/2001/XMLSchema}int"/&gt; * &lt;element name="material_number" type="{http://www.w3.org/2001/XMLSchema}string"/&gt;
* &lt;element name="material_type" type="{}material_typeType"/&gt; * &lt;element name="material_type" type="{}material_typeType"/&gt;
* &lt;element name="material_name" type="{http://www.w3.org/2001/XMLSchema}string"/&gt; * &lt;element name="material_name" type="{http://www.w3.org/2001/XMLSchema}string"/&gt;
* &lt;element name="description" type="{http://www.w3.org/2001/XMLSchema}string"/&gt; * &lt;element name="description" type="{http://www.w3.org/2001/XMLSchema}string"/&gt;
@@ -55,8 +55,8 @@ import javax.xml.bind.annotation.XmlType;
public class MaterialType { public class MaterialType {
protected int id; protected int id;
@XmlElement(name = "material_number") @XmlElement(name = "material_number", required = true)
protected int materialNumber; protected String materialNumber;
@XmlElement(name = "material_type", required = true) @XmlElement(name = "material_type", required = true)
@XmlSchemaType(name = "string") @XmlSchemaType(name = "string")
protected MaterialTypeType materialType; protected MaterialTypeType materialType;
@@ -71,7 +71,7 @@ public class MaterialType {
/** /**
* Gets the value of the id property. * Gets the value of the id property.
* *
*/ */
public int getId() { public int getId() {
return id; return id;
@@ -79,7 +79,7 @@ public class MaterialType {
/** /**
* Sets the value of the id property. * Sets the value of the id property.
* *
*/ */
public void setId(int value) { public void setId(int value) {
this.id = value; this.id = value;
@@ -87,27 +87,35 @@ public class MaterialType {
/** /**
* Gets the value of the materialNumber property. * Gets the value of the materialNumber property.
* *
* @return
* possible object is
* {@link String }
*
*/ */
public int getMaterialNumber() { public String getMaterialNumber() {
return materialNumber; return materialNumber;
} }
/** /**
* Sets the value of the materialNumber property. * Sets the value of the materialNumber property.
* *
* @param value
* allowed object is
* {@link String }
*
*/ */
public void setMaterialNumber(int value) { public void setMaterialNumber(String value) {
this.materialNumber = value; this.materialNumber = value;
} }
/** /**
* Gets the value of the materialType property. * Gets the value of the materialType property.
* *
* @return * @return
* possible object is * possible object is
* {@link MaterialTypeType } * {@link MaterialTypeType }
* *
*/ */
public MaterialTypeType getMaterialType() { public MaterialTypeType getMaterialType() {
return materialType; return materialType;
@@ -115,11 +123,11 @@ public class MaterialType {
/** /**
* Sets the value of the materialType property. * Sets the value of the materialType property.
* *
* @param value * @param value
* allowed object is * allowed object is
* {@link MaterialTypeType } * {@link MaterialTypeType }
* *
*/ */
public void setMaterialType(MaterialTypeType value) { public void setMaterialType(MaterialTypeType value) {
this.materialType = value; this.materialType = value;
@@ -127,11 +135,11 @@ public class MaterialType {
/** /**
* Gets the value of the materialName property. * Gets the value of the materialName property.
* *
* @return * @return
* possible object is * possible object is
* {@link String } * {@link String }
* *
*/ */
public String getMaterialName() { public String getMaterialName() {
return materialName; return materialName;
@@ -139,11 +147,11 @@ public class MaterialType {
/** /**
* Sets the value of the materialName property. * Sets the value of the materialName property.
* *
* @param value * @param value
* allowed object is * allowed object is
* {@link String } * {@link String }
* *
*/ */
public void setMaterialName(String value) { public void setMaterialName(String value) {
this.materialName = value; this.materialName = value;
@@ -151,11 +159,11 @@ public class MaterialType {
/** /**
* Gets the value of the description property. * Gets the value of the description property.
* *
* @return * @return
* possible object is * possible object is
* {@link String } * {@link String }
* *
*/ */
public String getDescription() { public String getDescription() {
return description; return description;
@@ -163,11 +171,11 @@ public class MaterialType {
/** /**
* Sets the value of the description property. * Sets the value of the description property.
* *
* @param value * @param value
* allowed object is * allowed object is
* {@link String } * {@link String }
* *
*/ */
public void setDescription(String value) { public void setDescription(String value) {
this.description = value; this.description = value;
@@ -175,7 +183,7 @@ public class MaterialType {
/** /**
* Gets the value of the isDeleted property. * Gets the value of the isDeleted property.
* *
*/ */
public boolean isIsDeleted() { public boolean isIsDeleted() {
return isDeleted; return isDeleted;
@@ -183,7 +191,7 @@ public class MaterialType {
/** /**
* Sets the value of the isDeleted property. * Sets the value of the isDeleted property.
* *
*/ */
public void setIsDeleted(boolean value) { public void setIsDeleted(boolean value) {
this.isDeleted = value; this.isDeleted = value;
@@ -191,25 +199,25 @@ public class MaterialType {
/** /**
* Gets the value of the packages property. * Gets the value of the packages property.
* *
* <p> * <p>
* This accessor method returns a reference to the live list, * This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the * not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object. * returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the packages property. * This is why there is not a <CODE>set</CODE> method for the packages property.
* *
* <p> * <p>
* For example, to add a new item, do as follows: * For example, to add a new item, do as follows:
* <pre> * <pre>
* getPackages().add(newItem); * getPackages().add(newItem);
* </pre> * </pre>
* *
* *
* <p> * <p>
* Objects of the following type(s) are allowed in the list * Objects of the following type(s) are allowed in the list
* {@link Package } * {@link Package }
* *
* *
*/ */
public List<Package> getPackages() { public List<Package> getPackages() {
if (packages == null) { if (packages == null) {

View File

@@ -2,7 +2,7 @@
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.2
// See <a href="https://javaee.github.io/jaxb-v2/">https://javaee.github.io/jaxb-v2/</a> // See <a href="https://javaee.github.io/jaxb-v2/">https://javaee.github.io/jaxb-v2/</a>
// Any modifications to this file will be lost upon recompilation of the source schema. // Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2021.11.17 at 01:26:11 PM CET // Generated on: 2021.11.18 at 12:37:46 PM CET
// //

View File

@@ -2,7 +2,7 @@
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.2
// See <a href="https://javaee.github.io/jaxb-v2/">https://javaee.github.io/jaxb-v2/</a> // See <a href="https://javaee.github.io/jaxb-v2/">https://javaee.github.io/jaxb-v2/</a>
// Any modifications to this file will be lost upon recompilation of the source schema. // Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2021.11.17 at 01:26:11 PM CET // Generated on: 2021.11.18 at 12:37:46 PM CET
// //

View File

@@ -2,7 +2,7 @@
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.2 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.2
// See <a href="https://javaee.github.io/jaxb-v2/">https://javaee.github.io/jaxb-v2/</a> // See <a href="https://javaee.github.io/jaxb-v2/">https://javaee.github.io/jaxb-v2/</a>
// Any modifications to this file will be lost upon recompilation of the source schema. // Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2021.11.17 at 01:26:11 PM CET // Generated on: 2021.11.18 at 12:37:46 PM CET
// //