154 lines
4.9 KiB
Java
154 lines
4.9 KiB
Java
|
|
package it.acxent.contab;
|
||
|
|
|
||
|
|
import it.acxent.db.ApplParmFull;
|
||
|
|
import it.acxent.db.WcString;
|
||
|
|
import it.acxent.util.Vectumerator;
|
||
|
|
import java.io.Serializable;
|
||
|
|
import java.sql.PreparedStatement;
|
||
|
|
import java.sql.SQLException;
|
||
|
|
|
||
|
|
public class xDocFiglioPadre extends _ContabAdapter implements Serializable {
|
||
|
|
private long id_documentoPadre;
|
||
|
|
|
||
|
|
private long id_documentoFiglio;
|
||
|
|
|
||
|
|
private Documento documentoPadre;
|
||
|
|
|
||
|
|
private Documento documentoFiglio;
|
||
|
|
|
||
|
|
private long id_docFiglioPadre;
|
||
|
|
|
||
|
|
public xDocFiglioPadre(ApplParmFull newApplParmFull) {
|
||
|
|
super(newApplParmFull);
|
||
|
|
}
|
||
|
|
|
||
|
|
public xDocFiglioPadre() {}
|
||
|
|
|
||
|
|
public void setId_documentoPadre(long newId_documentoPadre) {
|
||
|
|
this.id_documentoPadre = newId_documentoPadre;
|
||
|
|
setDocumentoPadre(null);
|
||
|
|
}
|
||
|
|
|
||
|
|
public void setId_documentoFiglio(long newId_documentoFiglio) {
|
||
|
|
this.id_documentoFiglio = newId_documentoFiglio;
|
||
|
|
setDocumentoFiglio(null);
|
||
|
|
}
|
||
|
|
|
||
|
|
public long getId_documentoPadre() {
|
||
|
|
return this.id_documentoPadre;
|
||
|
|
}
|
||
|
|
|
||
|
|
public long getId_documentoFiglio() {
|
||
|
|
return this.id_documentoFiglio;
|
||
|
|
}
|
||
|
|
|
||
|
|
public void setDocumentoPadre(Documento newDocumentoPadre) {
|
||
|
|
this.documentoPadre = newDocumentoPadre;
|
||
|
|
}
|
||
|
|
|
||
|
|
public Documento getDocumentoPadre() {
|
||
|
|
this.documentoPadre = (Documento)getSecondaryObject(this.documentoPadre, Documento.class,
|
||
|
|
getId_documentoPadre());
|
||
|
|
return this.documentoPadre;
|
||
|
|
}
|
||
|
|
|
||
|
|
public void setDocumentoFiglio(Documento newDocumentoFiglio) {
|
||
|
|
this.documentoFiglio = newDocumentoFiglio;
|
||
|
|
}
|
||
|
|
|
||
|
|
public Documento getDocumentoFiglio() {
|
||
|
|
this.documentoFiglio = (Documento)getSecondaryObject(this.documentoFiglio, Documento.class,
|
||
|
|
getId_documentoFiglio());
|
||
|
|
return this.documentoFiglio;
|
||
|
|
}
|
||
|
|
|
||
|
|
protected void deleteCascade() {}
|
||
|
|
|
||
|
|
public Vectumerator findByCR(xDocFiglioPadreCR CR, int pageNumber, int pageRows) {
|
||
|
|
String s_Sql_Find = "select A.* from DOC_FIGLIO_PADRE AS A";
|
||
|
|
String s_Sql_Order = "";
|
||
|
|
WcString wc = new WcString();
|
||
|
|
try {
|
||
|
|
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find +
|
||
|
|
wc.toString());
|
||
|
|
return findRows(stmt, pageNumber, pageRows);
|
||
|
|
} catch (SQLException e) {
|
||
|
|
removeCPConnection();
|
||
|
|
handleDebug(e);
|
||
|
|
return AB_EMPTY_VECTUMERATOR;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
public Vectumerator findByDocumentoPadre(long l_id_documentoPadre) {
|
||
|
|
String s_Sql_Find = "select A.* from DOC_FIGLIO_PADRE AS A, DOCUMENTO as B";
|
||
|
|
String s_Sql_Order = " order by B.id_esercizio, B.progDocumento";
|
||
|
|
WcString wc = new WcString();
|
||
|
|
wc.addWc("A.id_documentoFiglio=B.id_documento");
|
||
|
|
wc.addWc("A.id_documentoPadre=" + l_id_documentoPadre);
|
||
|
|
try {
|
||
|
|
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find +
|
||
|
|
wc.toString());
|
||
|
|
return findRows(stmt);
|
||
|
|
} catch (SQLException e) {
|
||
|
|
removeCPConnection();
|
||
|
|
handleDebug(e);
|
||
|
|
return AB_EMPTY_VECTUMERATOR;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
public void findByDocumentoFiglioPadre(long l_id_documentoFiglio, long l_id_documentoPadre) {
|
||
|
|
String s_Sql_Find = "select A.* from DOC_FIGLIO_PADRE AS A";
|
||
|
|
WcString wc = new WcString();
|
||
|
|
wc.addWc("A.id_documentoFiglio=" + l_id_documentoFiglio);
|
||
|
|
wc.addWc("A.id_documentoPadre=" + l_id_documentoPadre);
|
||
|
|
try {
|
||
|
|
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find);
|
||
|
|
findFirstRecord(stmt);
|
||
|
|
} catch (SQLException e) {
|
||
|
|
removeCPConnection();
|
||
|
|
handleDebug(e);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
public long getId_docFiglioPadre() {
|
||
|
|
return this.id_docFiglioPadre;
|
||
|
|
}
|
||
|
|
|
||
|
|
public void setId_docFiglioPadre(long id_docFiglioPadre) {
|
||
|
|
this.id_docFiglioPadre = id_docFiglioPadre;
|
||
|
|
}
|
||
|
|
|
||
|
|
public void findByDocumentoPadreTipoFiglio(long l_id_documentoPadre, long l_id_tipoDocumentoFiglio) {
|
||
|
|
String s_Sql_Find = "select A.* from DOC_FIGLIO_PADRE AS A, DOCUMENTO AS B";
|
||
|
|
String s_Sql_Order = "";
|
||
|
|
WcString wc = new WcString();
|
||
|
|
wc.addWc("A.id_documentoFiglio=B.id_documento");
|
||
|
|
wc.addWc("A.id_documentoPadre=" + l_id_documentoPadre);
|
||
|
|
wc.addWc("B.id_tipoDocumento=" + l_id_tipoDocumentoFiglio);
|
||
|
|
try {
|
||
|
|
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find +
|
||
|
|
wc.toString());
|
||
|
|
findFirstRecord(stmt);
|
||
|
|
} catch (SQLException e) {
|
||
|
|
removeCPConnection();
|
||
|
|
handleDebug(e);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
public Vectumerator findByDocumentoFiglio(long l_id_documentoFiglio) {
|
||
|
|
String s_Sql_Find = "select A.* from DOC_FIGLIO_PADRE AS A, DOCUMENTO as B";
|
||
|
|
String s_Sql_Order = " order by B.id_esercizio, B.progDocumento";
|
||
|
|
WcString wc = new WcString();
|
||
|
|
wc.addWc("A.id_documentoPadre=B.id_documento");
|
||
|
|
wc.addWc("A.id_documentoFiglio=" + l_id_documentoFiglio);
|
||
|
|
try {
|
||
|
|
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find +
|
||
|
|
wc.toString());
|
||
|
|
return findRows(stmt);
|
||
|
|
} catch (SQLException e) {
|
||
|
|
removeCPConnection();
|
||
|
|
handleDebug(e);
|
||
|
|
return AB_EMPTY_VECTUMERATOR;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|