modifiche alle tabelle delle linee articoli
All checks were successful
IntegryManagementSystem_Multi/pipeline/head This commit looks good
All checks were successful
IntegryManagementSystem_Multi/pipeline/head This commit looks good
This commit is contained in:
@@ -0,0 +1,90 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.IntegryCustomer;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
import it.integry.ems_model.utility.dto.IndexTableDTO;
|
||||
import it.integry.ems_model.utility.dto.PkTableDTO;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
public class Migration_20251127114735 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
executeStatement(
|
||||
"exec DropForeignKey 'mtb_aart', 'mtb_marchio_linea'",
|
||||
"exec DropForeignKey 'mtb_aart', 'mtb_marchio_slinea'",
|
||||
"exec DropForeignKey 'mtb_aart', 'mtb_marchio_sslinea'",
|
||||
"exec DropForeignKey 'mtb_marchio_sslinea', 'mtb_marchio_slinea'",
|
||||
"exec DropForeignKey 'mtb_marchio_slinea', 'mtb_marchio_linea'",
|
||||
"exec DropForeignKey 'mtb_marchio_linea', 'mtb_aart_marchio'",
|
||||
"exec DropPrimaryKey 'mtb_marchio_linea'",
|
||||
"exec DropPrimaryKey 'mtb_marchio_slinea'",
|
||||
"exec DropPrimaryKey 'mtb_marchio_sslinea'",
|
||||
"alter table mtb_marchio_linea drop column id_marchio",
|
||||
"alter table mtb_marchio_slinea drop column cod_linea",
|
||||
"alter table mtb_marchio_sslinea drop column cod_slinea",
|
||||
"exec sp_rename 'mtb_marchio_linea', 'mtb_aart_linea'",
|
||||
"exec sp_rename 'mtb_marchio_slinea', 'mtb_aart_slinea'",
|
||||
"exec sp_rename 'mtb_marchio_sslinea', 'mtb_aart_sslinea'"
|
||||
);
|
||||
|
||||
PkTableDTO pkTableDTO = new PkTableDTO()
|
||||
.setTableName("mtb_aart_linea")
|
||||
.setColumns(Arrays.asList(
|
||||
new PkTableDTO.Column("cod_linea")
|
||||
));
|
||||
createPrimaryKey(pkTableDTO);
|
||||
|
||||
pkTableDTO = new PkTableDTO()
|
||||
.setTableName("mtb_aart_slinea")
|
||||
.setColumns(Arrays.asList(
|
||||
new PkTableDTO.Column("cod_slinea")
|
||||
));
|
||||
createPrimaryKey(pkTableDTO);
|
||||
|
||||
|
||||
pkTableDTO = new PkTableDTO()
|
||||
.setTableName("mtb_aart_sslinea")
|
||||
.setColumns(Arrays.asList(
|
||||
new PkTableDTO.Column("cod_sslinea")
|
||||
));
|
||||
createPrimaryKey(pkTableDTO);
|
||||
|
||||
executeStatement(
|
||||
"ALTER TABLE mtb_aart ADD CONSTRAINT fk_mtb_aart_mtb_aart_linea "
|
||||
+ "FOREIGN KEY (cod_linea) REFERENCES mtb_aart_linea(cod_linea);",
|
||||
"ALTER TABLE mtb_aart ADD CONSTRAINT fk_mtb_aart_mtb_aart_slinea "
|
||||
+ "FOREIGN KEY (cod_slinea) REFERENCES mtb_aart_slinea(cod_slinea);",
|
||||
"ALTER TABLE mtb_aart ADD CONSTRAINT fk_mtb_aart_mtb_aart_sslinea "
|
||||
+ "FOREIGN KEY (cod_sslinea) REFERENCES mtb_aart_sslinea(cod_sslinea);");
|
||||
|
||||
dropIndex("mtb_aart_marchio", "marchio");
|
||||
|
||||
|
||||
executeStatement(
|
||||
"insert into mtb_aart_marchio\n" +
|
||||
"select distinct marchio\n" +
|
||||
"from mtb_aart\n" +
|
||||
"where marchio is not null\n" +
|
||||
"except\n" +
|
||||
"select marchio\n" +
|
||||
"from mtb_aart_marchio",
|
||||
"exec DropForeignKey 'mtb_aart', 'mtb_aart_marchio' ",
|
||||
"alter table mtb_aart drop column id_marchio ",
|
||||
"exec DropPrimaryKey 'mtb_aart_marchio' ",
|
||||
"alter table mtb_aart_marchio drop column id ",
|
||||
"alter table mtb_aart_marchio add constraint pk_mtb_aart_marchio primary key (marchio) ",
|
||||
"ALTER TABLE mtb_aart ADD CONSTRAINT fk_mtb_aart_mtb_aart_marchio FOREIGN KEY (marchio) REFERENCES mtb_aart_marchio(marchio) ");
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
}
|
||||
}
|
||||
@@ -1044,7 +1044,7 @@ public class CommonRules extends QueryRules {
|
||||
Boolean existMarchio = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(conn, sql);
|
||||
MtbAartMarchio mtbAartMarchio = null;
|
||||
|
||||
if (existMarchio) {
|
||||
if (!existMarchio) {
|
||||
mtbAartMarchio = new MtbAartMarchio();
|
||||
mtbAartMarchio.setMarchio(entity.getMarchio());
|
||||
mtbAartMarchio.setOperation(OperationType.INSERT);
|
||||
|
||||
@@ -310,9 +310,6 @@ public class MtbAart extends EntityBase implements EquatableEntityInterface<MtbA
|
||||
@SqlField(value = "flag_reso_tec", nullable = false, defaultObjectValue = "0")
|
||||
private Boolean flagResoTec;
|
||||
|
||||
@SqlField(value = "id_marchio")
|
||||
private Long idMarchio;
|
||||
|
||||
@SqlField(value = "cod_mssfa", maxLength = 6)
|
||||
private String codMssfa;
|
||||
|
||||
@@ -1322,15 +1319,6 @@ public class MtbAart extends EntityBase implements EquatableEntityInterface<MtbA
|
||||
return this;
|
||||
}
|
||||
|
||||
public Long getIdMarchio() {
|
||||
return idMarchio;
|
||||
}
|
||||
|
||||
public MtbAart setIdMarchio(Long idMarchio) {
|
||||
this.idMarchio = idMarchio;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodMssfa() {
|
||||
return codMssfa;
|
||||
}
|
||||
@@ -1447,13 +1435,12 @@ public class MtbAart extends EntityBase implements EquatableEntityInterface<MtbA
|
||||
Objects.equals(getDataUltVar(), mtbAart.getDataUltVar()) &&
|
||||
Objects.equals(getPercSfrido(), mtbAart.getPercSfrido()) &&
|
||||
Objects.equals(getCodBarreImb(), mtbAart.getCodBarreImb()) && Objects.equals(getFlagCalcPrz(), mtbAart.getFlagCalcPrz()) && Objects.equals(getEsposizioneCompAcq(), mtbAart.getEsposizioneCompAcq()) && Objects.equals(getFlagCalcPrzAcq(), mtbAart.getFlagCalcPrzAcq()) && Objects.equals(getDiacod(), mtbAart.getDiacod()) && Objects.equals(getPlu(), mtbAart.getPlu()) && Objects.equals(getPartIvaProd(), mtbAart.getPartIvaProd()) && Objects.equals(getRagSocProd(), mtbAart.getRagSocProd()) && Objects.equals(getFlagRapConvVariabile(), mtbAart.getFlagRapConvVariabile()) && Objects.equals(getFlagMovArtMag(), mtbAart.getFlagMovArtMag()) && Objects.equals(getFlagTracciabilita(), mtbAart.getFlagTracciabilita()) && Objects.equals(getTaraKg(), mtbAart.getTaraKg()) && Objects.equals(getColliStrato(), mtbAart.getColliStrato()) && Objects.equals(getFlagQtaCnfFissa(), mtbAart.getFlagQtaCnfFissa()) && Objects.equals(getFlagColliPedanaFisso(), mtbAart.getFlagColliPedanaFisso()) && Objects.equals(getCodCconCosti(), mtbAart.getCodCconCosti()) && Objects.equals(getCodCconRicavi(), mtbAart.getCodCconRicavi()) && Objects.equals(getCodDgrpArt(), mtbAart.getCodDgrpArt()) && Objects.equals(getCodDiviCar(), mtbAart.getCodDiviCar()) && Objects.equals(getCodDiviScar(), mtbAart.getCodDiviScar()) && Objects.equals(getCodEcrCat(), mtbAart.getCodEcrCat()) && Objects.equals(getCodEcrMcat(), mtbAart.getCodEcrMcat()) && Objects.equals(getCodEcrRep(), mtbAart.getCodEcrRep()) && Objects.equals(getCodEcrStipo(), mtbAart.getCodEcrStipo()) && Objects.equals(getCodEcrTipo(), mtbAart.getCodEcrTipo()) && Objects.equals(getCodGrpBolla(), mtbAart.getCodGrpBolla()) && Objects.equals(getIngredienti(), mtbAart.getIngredienti()) && Objects.equals(getIdArtEqui(), mtbAart.getIdArtEqui()) && Objects.equals(getDescrCassa(), mtbAart.getDescrCassa()) && Objects.equals(getCodNcIntracee(), mtbAart.getCodNcIntracee()) && Objects.equals(getMarchio(), mtbAart.getMarchio()) && Objects.equals(getSezione(), mtbAart.getSezione()) && Objects.equals(getTipoReg(), mtbAart.getTipoReg()) && Objects.equals(getTipoStock(), mtbAart.getTipoStock()) && Objects.equals(getQtaMultiplaOrd(), mtbAart.getQtaMultiplaOrd()) && Objects.equals(getFlagKit(), mtbAart.getFlagKit()) && Objects.equals(getCodFornCv(), mtbAart.getCodFornCv()) && Objects.equals(getCpa(), mtbAart.getCpa()) && Objects.equals(getTaric(), mtbAart.getTaric()) && Objects.equals(getSezioneDogana(), mtbAart.getSezioneDogana()) && Objects.equals(getFlagPesoEgalizzato(), mtbAart.getFlagPesoEgalizzato()) && Objects.equals(getCodJfasCosti(), mtbAart.getCodJfasCosti()) && Objects.equals(getCodJfasRicavi(), mtbAart.getCodJfasRicavi()) && Objects.equals(getMtbAartEqui_descrizione(), mtbAart.getMtbAartEqui_descrizione()) && Objects.equals(getFlagArrPrzVendIva(), mtbAart.getFlagArrPrzVendIva()) && Objects.equals(getClassificazioneAbc(), mtbAart.getClassificazioneAbc()) && Objects.equals(getTipoCodiceImballo(), mtbAart.getTipoCodiceImballo()) &&
|
||||
Objects.equals(getIdMarchio(), mtbAart.getIdMarchio()) &&
|
||||
Objects.equals(getFlagResoTec(), mtbAart.getFlagResoTec());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(getCodMart(), getDescrizione(), getUntMis(), getBarCode(), getPesoKg(), getQtaCnf(), getCodAliq(), getCodScoArt(), getCodTcolUi(), getCodTcolUl(), getArticoloComposto(), getEsposizioneComp(), getDescrizioneEstesa(), getCodUltForn(), getDataUltCar(), getValUltCar(), getCodUltClie(), getDataUltScar(), getValUltScar(), getTipoCodice(), getNote(), getPosizione(), getColliPedana(), getUntMis2(), getRapConv2(), getFlagInclListino(), getUntMis3(), getRapConv3(), getCodMartStat(), getCodMcon(), getCodMgrp(), getCodMsfa(), getCodMsgr(), getCodMstp(), getCodMtip(), getDescrizioneStat(), getFlagStato(), getCambioDiviCar(), getCambioDiviScar(), getGgScadPartita(), getVolumeMc(), getFlagEsponiPrz(), getDataUltVar(), getPercSfrido(), getCodBarreImb(), getFlagCalcPrz(), getEsposizioneCompAcq(), getFlagCalcPrzAcq(), getDiacod(), getPlu(), getPartIvaProd(), getRagSocProd(), getFlagRapConvVariabile(), getFlagMovArtMag(), getFlagTracciabilita(), getTaraKg(), getColliStrato(), getFlagQtaCnfFissa(), getFlagColliPedanaFisso(), getCodCconCosti(), getCodCconRicavi(), getCodDgrpArt(), getCodDiviCar(), getCodDiviScar(), getCodEcrCat(), getCodEcrMcat(), getCodEcrRep(), getCodEcrStipo(), getCodEcrTipo(), getCodGrpBolla(), getIngredienti(), getIdArtEqui(), getDescrCassa(), getCodNcIntracee(), getMarchio(), getSezione(), getTipoReg(), getTipoStock(), getQtaMultiplaOrd(), getFlagKit(), getCodFornCv(), getCpa(), getTaric(), getSezioneDogana(), getFlagPesoEgalizzato(), getCodJfasCosti(), getCodJfasRicavi(), getMtbAartEqui_descrizione(), getFlagArrPrzVendIva(), getClassificazioneAbc(), getTipoCodiceImballo(), getIdMarchio(), getFlagResoTec());
|
||||
return Objects.hash(getCodMart(), getDescrizione(), getUntMis(), getBarCode(), getPesoKg(), getQtaCnf(), getCodAliq(), getCodScoArt(), getCodTcolUi(), getCodTcolUl(), getArticoloComposto(), getEsposizioneComp(), getDescrizioneEstesa(), getCodUltForn(), getDataUltCar(), getValUltCar(), getCodUltClie(), getDataUltScar(), getValUltScar(), getTipoCodice(), getNote(), getPosizione(), getColliPedana(), getUntMis2(), getRapConv2(), getFlagInclListino(), getUntMis3(), getRapConv3(), getCodMartStat(), getCodMcon(), getCodMgrp(), getCodMsfa(), getCodMsgr(), getCodMstp(), getCodMtip(), getDescrizioneStat(), getFlagStato(), getCambioDiviCar(), getCambioDiviScar(), getGgScadPartita(), getVolumeMc(), getFlagEsponiPrz(), getDataUltVar(), getPercSfrido(), getCodBarreImb(), getFlagCalcPrz(), getEsposizioneCompAcq(), getFlagCalcPrzAcq(), getDiacod(), getPlu(), getPartIvaProd(), getRagSocProd(), getFlagRapConvVariabile(), getFlagMovArtMag(), getFlagTracciabilita(), getTaraKg(), getColliStrato(), getFlagQtaCnfFissa(), getFlagColliPedanaFisso(), getCodCconCosti(), getCodCconRicavi(), getCodDgrpArt(), getCodDiviCar(), getCodDiviScar(), getCodEcrCat(), getCodEcrMcat(), getCodEcrRep(), getCodEcrStipo(), getCodEcrTipo(), getCodGrpBolla(), getIngredienti(), getIdArtEqui(), getDescrCassa(), getCodNcIntracee(), getMarchio(), getSezione(), getTipoReg(), getTipoStock(), getQtaMultiplaOrd(), getFlagKit(), getCodFornCv(), getCpa(), getTaric(), getSezioneDogana(), getFlagPesoEgalizzato(), getCodJfasCosti(), getCodJfasRicavi(), getMtbAartEqui_descrizione(), getFlagArrPrzVendIva(), getClassificazioneAbc(), getTipoCodiceImballo(), getFlagResoTec());
|
||||
}
|
||||
|
||||
public static MtbAart fromCodMart(String codMart) {
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
package it.integry.ems_model.entity;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import it.integry.ems_model.base.EntityBase;
|
||||
import it.integry.ems_model.annotation.Master;
|
||||
import org.kie.api.definition.type.PropertyReactive;
|
||||
import it.integry.ems_model.annotation.Table;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import it.integry.ems_model.annotation.PK;
|
||||
import it.integry.ems_model.annotation.SqlField;
|
||||
|
||||
@Master()
|
||||
@PropertyReactive()
|
||||
@Table(value = MtbAartLinea.ENTITY)
|
||||
@JsonTypeName(value = MtbAartLinea.ENTITY)
|
||||
public class MtbAartLinea extends EntityBase {
|
||||
|
||||
public final static String ENTITY = "mtb_aart_linea";
|
||||
|
||||
private final static Long serialVersionUID = 1L;
|
||||
|
||||
private final static Logger logger = LogManager.getLogger();
|
||||
|
||||
public MtbAartLinea() {
|
||||
super(logger);
|
||||
}
|
||||
|
||||
@PK()
|
||||
@SqlField(value = "cod_linea", maxLength = 6, nullable = false)
|
||||
private String codLinea;
|
||||
|
||||
@SqlField(value = "descrizione", maxLength = 255, nullable = false)
|
||||
private String descrizione;
|
||||
|
||||
public String getCodLinea() {
|
||||
return codLinea;
|
||||
}
|
||||
|
||||
public MtbAartLinea setCodLinea(String codLinea) {
|
||||
this.codLinea = codLinea;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return descrizione;
|
||||
}
|
||||
|
||||
public MtbAartLinea setDescrizione(String descrizione) {
|
||||
this.descrizione = descrizione;
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -24,41 +24,14 @@ public class MtbAartMarchio extends EntityBase implements EquatableEntityInterfa
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@PK
|
||||
@Identity
|
||||
@SqlField(value = "id", nullable = false)
|
||||
private Long id;
|
||||
|
||||
@Unique
|
||||
@PK
|
||||
@SqlField(value = "marchio", maxLength = 255, nullable = false)
|
||||
private String marchio;
|
||||
|
||||
@EntityChild
|
||||
private List<MtbMarchioLinea> mtbMarchioLinea = new ArrayList<>();
|
||||
|
||||
@EntityChild
|
||||
private List<MtbMarchioSlinea> mtbMarchioSlinea = new ArrayList<>();
|
||||
|
||||
@EntityChild
|
||||
private List<MtbMarchioSslinea> mtbMarchioSslinea;
|
||||
|
||||
{
|
||||
mtbMarchioSslinea = new ArrayList<>();
|
||||
}
|
||||
|
||||
|
||||
public MtbAartMarchio() {
|
||||
super(logger);
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public MtbAartMarchio setId(Long id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public String getMarchio() {
|
||||
return marchio;
|
||||
}
|
||||
@@ -68,43 +41,6 @@ public class MtbAartMarchio extends EntityBase implements EquatableEntityInterfa
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<MtbMarchioLinea> getMtbMarchioLinea() {
|
||||
return mtbMarchioLinea;
|
||||
}
|
||||
|
||||
public MtbAartMarchio setMtbMarchioLinea(List<MtbMarchioLinea> mtbMarchioLinea) {
|
||||
this.mtbMarchioLinea = mtbMarchioLinea;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<MtbMarchioSlinea> getMtbMarchioSlinea() {
|
||||
return mtbMarchioSlinea;
|
||||
}
|
||||
|
||||
public MtbAartMarchio setMtbMarchioSlinea(List<MtbMarchioSlinea> mtbMarchioSlinea) {
|
||||
this.mtbMarchioSlinea = mtbMarchioSlinea;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<MtbMarchioSslinea> getMtbMarchioSslinea() {
|
||||
return mtbMarchioSslinea;
|
||||
}
|
||||
|
||||
public MtbAartMarchio setMtbMarchioSslinea(List<MtbMarchioSslinea> mtbMarchioSslinea) {
|
||||
this.mtbMarchioSslinea = mtbMarchioSslinea;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void deleteChilds() throws Exception {
|
||||
MtbMarchioSslinea mtbMarchioSslinea = new MtbMarchioSslinea();
|
||||
mtbMarchioSslinea.deleteAllEntities(connection, this);
|
||||
MtbMarchioSlinea mtbMarchioSlinea = new MtbMarchioSlinea();
|
||||
mtbMarchioSlinea.deleteAllEntities(connection, this);
|
||||
MtbMarchioLinea mtbMarchioLinea = new MtbMarchioLinea();
|
||||
mtbMarchioLinea.deleteAllEntities(connection, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equalsKey(MtbAartMarchio other) {
|
||||
if (this == other)
|
||||
@@ -113,12 +49,12 @@ public class MtbAartMarchio extends EntityBase implements EquatableEntityInterfa
|
||||
if(hashCodeKey() != other.hashCodeKey())
|
||||
return false;
|
||||
|
||||
return Objects.equals(getId(), other.getId());
|
||||
return Objects.equals(getMarchio(), other.getMarchio());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCodeKey() {
|
||||
return Objects.hashCode(getId());
|
||||
return Objects.hashCode(getMarchio());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -126,11 +62,11 @@ public class MtbAartMarchio extends EntityBase implements EquatableEntityInterfa
|
||||
if (this == o) return true;
|
||||
if (!(o instanceof MtbAartMarchio)) return false;
|
||||
MtbAartMarchio mtbAartMarchio = (MtbAartMarchio) o;
|
||||
return Objects.equals(getId(), mtbAartMarchio.getId()) && Objects.equals(getMarchio(), mtbAartMarchio.getMarchio());
|
||||
return Objects.equals(getMarchio(), mtbAartMarchio.getMarchio()) && Objects.equals(getMarchio(), mtbAartMarchio.getMarchio());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(getId(), getMarchio());
|
||||
return Objects.hash(getMarchio(), getMarchio());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
package it.integry.ems_model.entity;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import it.integry.ems_model.base.EntityBase;
|
||||
import it.integry.ems_model.annotation.Master;
|
||||
import org.kie.api.definition.type.PropertyReactive;
|
||||
import it.integry.ems_model.annotation.Table;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import it.integry.ems_model.annotation.PK;
|
||||
import it.integry.ems_model.annotation.SqlField;
|
||||
|
||||
@Master()
|
||||
@PropertyReactive()
|
||||
@Table(value = MtbAartSlinea.ENTITY)
|
||||
@JsonTypeName(value = MtbAartSlinea.ENTITY)
|
||||
public class MtbAartSlinea extends EntityBase {
|
||||
|
||||
public final static String ENTITY = "mtb_aart_slinea";
|
||||
|
||||
private final static Long serialVersionUID = 1L;
|
||||
|
||||
private final static Logger logger = LogManager.getLogger();
|
||||
|
||||
public MtbAartSlinea() {
|
||||
super(logger);
|
||||
}
|
||||
|
||||
@PK()
|
||||
@SqlField(value = "cod_slinea", maxLength = 6, nullable = false)
|
||||
private String codSlinea;
|
||||
|
||||
@SqlField(value = "descrizione", maxLength = 255, nullable = false)
|
||||
private String descrizione;
|
||||
|
||||
public String getCodSlinea() {
|
||||
return codSlinea;
|
||||
}
|
||||
|
||||
public MtbAartSlinea setCodSlinea(String codSlinea) {
|
||||
this.codSlinea = codSlinea;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return descrizione;
|
||||
}
|
||||
|
||||
public MtbAartSlinea setDescrizione(String descrizione) {
|
||||
this.descrizione = descrizione;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -1,129 +0,0 @@
|
||||
package it.integry.ems_model.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import it.integry.ems_model.annotation.*;
|
||||
import it.integry.ems_model.base.EntityBase;
|
||||
import it.integry.ems_model.base.EquatableEntityInterface;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.kie.api.definition.type.PropertyReactive;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
@PropertyReactive()
|
||||
@Table(value = MtbMarchioLinea.ENTITY)
|
||||
@JsonTypeName(value = MtbMarchioLinea.ENTITY)
|
||||
public class MtbMarchioLinea extends EntityBase implements EquatableEntityInterface<MtbMarchioLinea> {
|
||||
|
||||
|
||||
public final static String ENTITY = "mtb_marchio_linea";
|
||||
|
||||
private final static Long serialVersionUID = 1L;
|
||||
|
||||
private final static Logger logger = LogManager.getLogger();
|
||||
|
||||
public MtbMarchioLinea() {
|
||||
super(logger);
|
||||
}
|
||||
|
||||
@SqlField(value = "id_marchio", nullable = false)
|
||||
@FK(tableName = MtbAartMarchio.ENTITY, columnName = "id")
|
||||
private Long idMarchio;
|
||||
|
||||
@PK()
|
||||
@SqlField(value = "cod_linea", maxLength = 6, nullable = false)
|
||||
private String codLinea;
|
||||
|
||||
@SqlField(value = "descrizione", maxLength = 255, nullable = false)
|
||||
private String descrizione;
|
||||
|
||||
@EntityChild()
|
||||
private List<MtbMarchioSlinea> mtbMarchioSlinea = new ArrayList<>();
|
||||
|
||||
@EntityChild()
|
||||
private List<MtbMarchioSslinea> mtbMarchioSslinea = new ArrayList<>();
|
||||
|
||||
public Long getIdMarchio() {
|
||||
return idMarchio;
|
||||
}
|
||||
|
||||
public MtbMarchioLinea setIdMarchio(Long idMarchio) {
|
||||
this.idMarchio = idMarchio;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodLinea() {
|
||||
return codLinea;
|
||||
}
|
||||
|
||||
public MtbMarchioLinea setCodLinea(String codLinea) {
|
||||
this.codLinea = codLinea;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return descrizione;
|
||||
}
|
||||
|
||||
public MtbMarchioLinea setDescrizione(String descrizione) {
|
||||
this.descrizione = descrizione;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<MtbMarchioSlinea> getMtbMarchioSlinea() {
|
||||
return mtbMarchioSlinea;
|
||||
}
|
||||
|
||||
public MtbMarchioLinea setMtbMarchioSlinea(List<MtbMarchioSlinea> mtbMarchioSlinea) {
|
||||
this.mtbMarchioSlinea = mtbMarchioSlinea;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<MtbMarchioSslinea> getMtbMarchioSslinea() {
|
||||
return mtbMarchioSslinea;
|
||||
}
|
||||
|
||||
public MtbMarchioLinea setMtbMarchioSslinea(List<MtbMarchioSslinea> mtbMarchioSslinea) {
|
||||
this.mtbMarchioSslinea = mtbMarchioSslinea;
|
||||
return this;
|
||||
}
|
||||
|
||||
protected void deleteChilds() throws Exception {
|
||||
MtbMarchioSslinea mtbMarchioSslinea = new MtbMarchioSslinea();
|
||||
mtbMarchioSslinea.deleteAllEntities(connection, this);
|
||||
MtbMarchioSlinea mtbMarchioSlinea = new MtbMarchioSlinea();
|
||||
mtbMarchioSlinea.deleteAllEntities(connection, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equalsKey(MtbMarchioLinea other) {
|
||||
if (this == other)
|
||||
return true;
|
||||
|
||||
if(hashCodeKey() != other.hashCodeKey())
|
||||
return false;
|
||||
|
||||
return Objects.equals(getIdMarchio(), other.getIdMarchio()) && Objects.equals(getCodLinea(), other.getCodLinea());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCodeKey() {
|
||||
return Objects.hash(getIdMarchio(), getCodLinea());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (!(o instanceof MtbMarchioLinea)) return false;
|
||||
MtbMarchioLinea mtbMarchioLinea = (MtbMarchioLinea) o;
|
||||
return Objects.equals(getIdMarchio(), mtbMarchioLinea.getIdMarchio()) && Objects.equals(getCodLinea(), mtbMarchioLinea.getCodLinea()) && Objects.equals(getDescrizione(), mtbMarchioLinea.getDescrizione());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(getIdMarchio(), getCodLinea(), getDescrizione());
|
||||
}
|
||||
}
|
||||
@@ -1,117 +0,0 @@
|
||||
package it.integry.ems_model.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import it.integry.ems_model.annotation.*;
|
||||
import it.integry.ems_model.base.EntityBase;
|
||||
import it.integry.ems_model.base.EquatableEntityInterface;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.kie.api.definition.type.PropertyReactive;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@PropertyReactive()
|
||||
@Table(value = MtbMarchioSlinea.ENTITY)
|
||||
@JsonTypeName(value = MtbMarchioSlinea.ENTITY)
|
||||
public class MtbMarchioSlinea extends EntityBase implements EquatableEntityInterface<MtbMarchioSlinea> {
|
||||
|
||||
public final static String ENTITY = "mtb_marchio_slinea";
|
||||
|
||||
private final static Long serialVersionUID = 1L;
|
||||
|
||||
private final static Logger logger = LogManager.getLogger();
|
||||
|
||||
public MtbMarchioSlinea() {
|
||||
super(logger);
|
||||
}
|
||||
|
||||
@SqlField(value = "cod_linea", maxLength = 6, nullable = false)
|
||||
@FK(tableName = MtbMarchioLinea.ENTITY, columnName = "cod_linea")
|
||||
private String codLinea;
|
||||
|
||||
@PK()
|
||||
@SqlField(value = "cod_slinea", maxLength = 6, nullable = false)
|
||||
private String codSlinea;
|
||||
|
||||
@SqlField(value = "descrizione", maxLength = 255, nullable = false)
|
||||
private String descrizione;
|
||||
|
||||
@EntityChild
|
||||
private List<MtbMarchioSslinea> mtbMarchioSslinea;
|
||||
|
||||
{
|
||||
mtbMarchioSslinea = new ArrayList<>();
|
||||
}
|
||||
|
||||
public String getCodLinea() {
|
||||
return codLinea;
|
||||
}
|
||||
|
||||
public MtbMarchioSlinea setCodLinea(String codLinea) {
|
||||
this.codLinea = codLinea;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodSlinea() {
|
||||
return codSlinea;
|
||||
}
|
||||
|
||||
public MtbMarchioSlinea setCodSlinea(String codSlinea) {
|
||||
this.codSlinea = codSlinea;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return descrizione;
|
||||
}
|
||||
|
||||
public MtbMarchioSlinea setDescrizione(String descrizione) {
|
||||
this.descrizione = descrizione;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<MtbMarchioSslinea> getMtbMarchioSslinea() {
|
||||
return mtbMarchioSslinea;
|
||||
}
|
||||
|
||||
public MtbMarchioSlinea setMtbMarchioSslinea(List<MtbMarchioSslinea> mtbMarchioSslinea) {
|
||||
this.mtbMarchioSslinea = mtbMarchioSslinea;
|
||||
return this;
|
||||
}
|
||||
|
||||
protected void deleteChilds() throws Exception {
|
||||
MtbMarchioSslinea mtbMarchioSslinea = new MtbMarchioSslinea();
|
||||
mtbMarchioSslinea.deleteAllEntities(connection, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equalsKey(MtbMarchioSlinea other) {
|
||||
if (this == other)
|
||||
return true;
|
||||
|
||||
if(hashCodeKey() != other.hashCodeKey())
|
||||
return false;
|
||||
|
||||
return Objects.equals(getCodLinea(), other.getCodLinea()) && Objects.equals(getCodSlinea(), other.getCodSlinea());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCodeKey() {
|
||||
return Objects.hash(getCodLinea(), getCodSlinea());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (!(o instanceof MtbMarchioSlinea)) return false;
|
||||
MtbMarchioSlinea mtbMarchioSlinea = (MtbMarchioSlinea) o;
|
||||
return Objects.equals(getCodLinea(), mtbMarchioSlinea.getCodLinea()) && Objects.equals(getCodSlinea(), mtbMarchioSlinea.getCodSlinea()) && Objects.equals(getDescrizione(), mtbMarchioSlinea.getDescrizione());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(getCodLinea(), getCodSlinea(), getDescrizione());
|
||||
}
|
||||
}
|
||||
@@ -1,97 +0,0 @@
|
||||
package it.integry.ems_model.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import it.integry.ems_model.annotation.FK;
|
||||
import it.integry.ems_model.annotation.PK;
|
||||
import it.integry.ems_model.annotation.SqlField;
|
||||
import it.integry.ems_model.annotation.Table;
|
||||
import it.integry.ems_model.base.EntityBase;
|
||||
import it.integry.ems_model.base.EquatableEntityInterface;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.kie.api.definition.type.PropertyReactive;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
@PropertyReactive()
|
||||
@Table(value = MtbMarchioSslinea.ENTITY)
|
||||
@JsonTypeName(value = MtbMarchioSslinea.ENTITY)
|
||||
public class MtbMarchioSslinea extends EntityBase implements EquatableEntityInterface<MtbMarchioSslinea> {
|
||||
|
||||
public final static String ENTITY = "mtb_marchio_sslinea";
|
||||
|
||||
private final static Long serialVersionUID = 1L;
|
||||
|
||||
private final static Logger logger = LogManager.getLogger();
|
||||
|
||||
public MtbMarchioSslinea() {
|
||||
super(logger);
|
||||
}
|
||||
|
||||
@SqlField(value = "cod_slinea", maxLength = 6, nullable = false)
|
||||
@FK(tableName = MtbMarchioSlinea.ENTITY, columnName = "cod_slinea")
|
||||
private String codSlinea;
|
||||
|
||||
@PK()
|
||||
@SqlField(value = "cod_sslinea", maxLength = 6, nullable = false)
|
||||
private String codSslinea;
|
||||
|
||||
@SqlField(value = "descrizione", maxLength = 255, nullable = false)
|
||||
private String descrizione;
|
||||
|
||||
public String getCodSlinea() {
|
||||
return codSlinea;
|
||||
}
|
||||
|
||||
public MtbMarchioSslinea setCodSlinea(String codSlinea) {
|
||||
this.codSlinea = codSlinea;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodSslinea() {
|
||||
return codSslinea;
|
||||
}
|
||||
|
||||
public MtbMarchioSslinea setCodSslinea(String codSslinea) {
|
||||
this.codSslinea = codSslinea;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return descrizione;
|
||||
}
|
||||
|
||||
public MtbMarchioSslinea setDescrizione(String descrizione) {
|
||||
this.descrizione = descrizione;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equalsKey(MtbMarchioSslinea other) {
|
||||
if (this == other)
|
||||
return true;
|
||||
|
||||
if(hashCodeKey() != other.hashCodeKey())
|
||||
return false;
|
||||
|
||||
return Objects.equals(getCodSlinea(), other.getCodSlinea()) && Objects.equals(getCodSslinea(), other.getCodSslinea());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCodeKey() {
|
||||
return Objects.hash(getCodSlinea(), getCodSslinea());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (!(o instanceof MtbMarchioSslinea)) return false;
|
||||
MtbMarchioSslinea mtbMarchioSslinea = (MtbMarchioSslinea) o;
|
||||
return Objects.equals(getCodSlinea(), mtbMarchioSslinea.getCodSlinea()) && Objects.equals(getCodSslinea(), mtbMarchioSslinea.getCodSslinea()) && Objects.equals(getDescrizione(), mtbMarchioSslinea.getDescrizione());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(getCodSlinea(), getCodSslinea(), getDescrizione());
|
||||
}
|
||||
}
|
||||
@@ -127,19 +127,6 @@ then
|
||||
}
|
||||
end
|
||||
|
||||
rule "completeIdMarchio"
|
||||
no-loop
|
||||
when
|
||||
eval(completeRulesEnabled)
|
||||
$entity : MtbAart(marchio != null && idMarchio == null && operation != OperationType.DELETE)
|
||||
then
|
||||
String sql = "SELECT id FROM mtb_aart_marchio WHERE marchio = '" + $entity.getMarchio() + "'";
|
||||
Long idMarchio = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(conn, sql);
|
||||
modify($entity) {
|
||||
setIdMarchio(idMarchio)
|
||||
}
|
||||
end
|
||||
|
||||
rule "completeInsEqui"
|
||||
no-loop
|
||||
when
|
||||
|
||||
Reference in New Issue
Block a user