package it.acxent.contab; import it.acxent.db.ApplParmFull; import it.acxent.db.DBAdapter; import it.acxent.db.DBAdapterException; import it.acxent.db.ResParm; import it.acxent.db.WcString; import it.acxent.util.StringTokenizer; import it.acxent.util.Vectumerator; import java.io.Serializable; import java.sql.Date; import java.sql.PreparedStatement; import java.sql.SQLException; public class MovContabile extends DBAdapter implements Serializable { private static final long serialVersionUID = 3773329117463754505L; private long id_movContabile; private String descrizione; private long id_causaleContabile; private Date dataMovContabile; private long flgStato; private CausaleContabile causaleContabile; public MovContabile(ApplParmFull newApplParmFull) { super(newApplParmFull); } public MovContabile() {} public long getId_movContabile() { return this.id_movContabile; } public void setId_movContabile(long id_incassoPagamento) { this.id_movContabile = id_incassoPagamento; } public Vectumerator findByCR(MovContabileCR CR, int pageNumber, int pageRows) { String s_Sql_Find = "select A.* from MOV_CONTABILE AS A"; String s_Sql_Order = ""; WcString wc = new WcString(); if (!CR.getSearchTxt().trim().isEmpty()) { StringTokenizer st = new StringTokenizer(CR.getSearchTxt().trim(), " "); StringBuffer txt = new StringBuffer("("); while (st.hasMoreTokens()) { String token = st.nextToken(); txt.append("(A.Cognome like '%" + token + "%' or A.Nome like '%" + token + "%')"); if (st.hasMoreTokens()) txt.append(" and "); } txt.append(")"); wc.addWc(txt.toString()); } try { PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString()); return findRows(stmt, pageNumber, pageRows); } catch (SQLException e) { handleDebug(e); return AB_EMPTY_VECTUMERATOR; } } protected void deleteCascade() {} protected ResParm checkDeleteCascade() throws DBAdapterException, SQLException { return null; } public String getDescrizione() { return (this.descrizione == null) ? "" : this.descrizione; } public void setDescrizione(String descrizione) { this.descrizione = descrizione; } public long getId_causaleContabile() { return this.id_causaleContabile; } public void setId_causaleContabile(long id_causaleContabile) { this.id_causaleContabile = id_causaleContabile; setCausaleContabile(null); } public Date getDataMovContabile() { return this.dataMovContabile; } public void setDataMovContabile(Date dataMovContabile) { this.dataMovContabile = dataMovContabile; } public long getFlgStato() { return this.flgStato; } public void setFlgStato(long flgStato) { this.flgStato = flgStato; } public CausaleContabile getCausaleContabile() { this.causaleContabile = (CausaleContabile)getSecondaryObject(this.causaleContabile, CausaleContabile.class, getId_causaleContabile()); return this.causaleContabile; } public void setCausaleContabile(CausaleContabile causaleContabile) { this.causaleContabile = causaleContabile; } }