001: /*
002: * Created on 05/04/2007
003: *
004: * Swing Components - visit http://sf.net/projects/gfd
005: *
006: * Copyright (C) 2007 Igor Regis da Silva Simões
007: *
008: * This program is free software; you can redistribute it and/or
009: * modify it under the terms of the GNU General Public License
010: * as published by the Free Software Foundation; either version 2
011: * of the License, or (at your option) any later version.
012: *
013: * This program is distributed in the hope that it will be useful,
014: * but WITHOUT ANY WARRANTY; without even the implied warranty of
015: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
016: * GNU General Public License for more details.
017: *
018: * You should have received a copy of the GNU General Public License
019: * along with this program; if not, write to the Free Software
020: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
021: *
022: */
023: package br.com.gfp.data;
024:
025: import java.sql.SQLException;
026:
027: import br.com.gfpshare.db.Column;
028: import br.com.gfpshare.db.Table;
029:
030: /**
031: * This class represent a saved script to import a csv file
032: *
033: * @author Igor Regis da Silva Simoes
034: * @since 05/04/2007
035: */
036: @Table(name="PrescriptedCSVImport")
037: public class PrescriptedCSVImport extends BasicGFPDataObject {
038: @Column(isPk=true,nome="Name",readMethodName="getName",writeMethodName="setName")
039: private String name = null;
040:
041: @Column(isPk=false,nome="Description",readMethodName="getDescription",writeMethodName="setDescription")
042: private String description = null;
043:
044: @Column(isPk=false,nome="HeadersToIgnore",readMethodName="getHeadersToIgnore",writeMethodName="setHeadersToIgnore")
045: private int headersToIgnore = 0;
046:
047: @Column(isPk=false,nome="FootersToIgnore",readMethodName="getFootersToIgnore",writeMethodName="setFootersToIgnore")
048: private int footersToIgnore = 0;
049:
050: @Column(isPk=false,nome="TransactionDateColumn",readMethodName="getTransactionDateColumn",writeMethodName="setTransactionDateColumn")
051: private int transactionDateColumn = -1;
052:
053: @Column(isPk=false,nome="TransactionAmountColumn",readMethodName="getTransactionAmountColumn",writeMethodName="setTransactionAmountColumn")
054: private int transactionAmountColumn = -1;
055:
056: @Column(isPk=false,nome="TransactionDescriptionColumn",readMethodName="getTransactionDescriptionColumn",writeMethodName="setTransactionDescriptionColumn")
057: private int transactionDescriptionColumn = -1;
058:
059: @Column(isPk=false,nome="Account",readMethodName="getAccount",writeMethodName="setAccount")
060: private int account = -1;
061:
062: @Column(isPk=false,nome="AccountType",readMethodName="getAccountType",writeMethodName="setAccountType")
063: private String accountType = null;
064:
065: @Column(isPk=false,nome="Separator",readMethodName="getSeparator",writeMethodName="setSeparator")
066: private char separator = ',';
067:
068: @Column(isPk=false,nome="ImportFromFile",readMethodName="getImportFromFile",writeMethodName="setImportFromFile")
069: private boolean importFromFile = true;
070:
071: public String getAsString(int format) {
072: //------------------------------------------------
073: // TODO Auto-generated method stub
074: return null;
075: }
076:
077: public void validate() throws SQLException {
078: //------------------------------------------------
079: // TODO Auto-generated method stub
080:
081: }
082:
083: /**
084: * @return the description
085: */
086: public String getDescription() {
087: return description;
088: }
089:
090: /**
091: * @param description the description to set
092: */
093: public void setDescription(String description) {
094: this .description = description;
095: }
096:
097: /**
098: * @return the name
099: */
100: public String getName() {
101: return name;
102: }
103:
104: /**
105: * @param name the name to set
106: */
107: public void setName(String name) {
108: this .name = name;
109: }
110:
111: /**
112: * @return the account
113: */
114: public int getAccount() {
115: return account;
116: }
117:
118: /**
119: * @param account the account to set
120: */
121: public void setAccount(Integer account) {
122: this .account = account == null ? -1 : account;
123: }
124:
125: /**
126: * @return the accountType
127: */
128: public Integer getAccountType() {
129: return accountType == null ? null : Integer
130: .parseInt(accountType);
131: }
132:
133: /**
134: * @param accountType the accountType to set
135: */
136: public void setAccountType(Integer accountType) {
137: this .accountType = accountType == null ? null : accountType
138: .toString();
139: }
140:
141: /**
142: * @return the footersToIgnore
143: */
144: public int getFootersToIgnore() {
145: return footersToIgnore;
146: }
147:
148: /**
149: * @param footersToIgnore the footersToIgnore to set
150: */
151: public void setFootersToIgnore(int footersToIgnore) {
152: this .footersToIgnore = footersToIgnore;
153: }
154:
155: /**
156: * @return the headersToIgnore
157: */
158: public int getHeadersToIgnore() {
159: return headersToIgnore;
160: }
161:
162: /**
163: * @param headersToIgnore the headersToIgnore to set
164: */
165: public void setHeadersToIgnore(int headersToIgnore) {
166: this .headersToIgnore = headersToIgnore;
167: }
168:
169: /**
170: * @return the separator
171: */
172: public char getSeparator() {
173: return separator;
174: }
175:
176: /**
177: * @param separator the separator to set
178: */
179: public void setSeparator(char separator) {
180: this .separator = separator;
181: }
182:
183: /**
184: * @return the transactionAmountColumn
185: */
186: public int getTransactionAmountColumn() {
187: return transactionAmountColumn;
188: }
189:
190: /**
191: * @param transactionAmountColumn the transactionAmountColumn to set
192: */
193: public void setTransactionAmountColumn(int transactionAmountColumn) {
194: this .transactionAmountColumn = transactionAmountColumn;
195: }
196:
197: /**
198: * @return the transactionDateColumn
199: */
200: public int getTransactionDateColumn() {
201: return transactionDateColumn;
202: }
203:
204: /**
205: * @param transactionDateColumn the transactionDateColumn to set
206: */
207: public void setTransactionDateColumn(int transactionDateColumn) {
208: this .transactionDateColumn = transactionDateColumn;
209: }
210:
211: /**
212: * @return the transactionDescriptionColumn
213: */
214: public int getTransactionDescriptionColumn() {
215: return transactionDescriptionColumn;
216: }
217:
218: /**
219: * @param transactionDescriptionColumn the transactionDescriptionColumn to set
220: */
221: public void setTransactionDescriptionColumn(
222: int transactionDescriptionColumn) {
223: this .transactionDescriptionColumn = transactionDescriptionColumn;
224: }
225:
226: /**
227: * @return the importFromFile
228: */
229: public boolean isImportFromFile() {
230: return importFromFile;
231: }
232:
233: /**
234: * @param importFromFile the importFromFile to set
235: */
236: public void setImportFromFile(boolean importFromFile) {
237: this.importFromFile = importFromFile;
238: }
239: }
|