Schema interface and its implementation

xiaoxiao2021-03-06  20

/ ** *

ClassName: Schema interface *

Description: *

Copyright: CopyRight (c) 2002 *

Company: * @author: * @version: * @date: * / public interface Schema {public static int TYPE_NOFOUND = -1; // public static int TYPE_MIN = -1; // the minimum value of type public static int TYPE_STRING = 0; // java.lang.string public static int type_date = 1; // java.util.date public static int type_float = 2; // Float public static int type_int = 3; // int public static int type_double = 4; // Double public static int type_max = 5; // the maximum value of type

PUBLIC STRING [] getpk ();

/ / Return the value of PUBLIC STRING GETV (String Fcode) by name or index;

Public String GetV (INT NINDEX);

/ / Return to the type of the field by name or index, such as schema.type_string public int getfieldtype (string strfieldname);

Public int GetFieldType (int NfieldIndex);

// Get the number of fields public int getfieldcount ();

// Name and index mutual check public int getfieldindex (String strfieldname);

Public String getfieldname (int nfieldIndex);

/ / Set public boolean setv (String StrfieldName, String String StrfieldValue);} / * *

ClassName: laholsschema *

Description: DB layer Schema class file *

CopyRight : Copyright (c) 2002 *

Company: sinosoft * @Database: management * @createdate: 2004-12-20 * / package com.schema;

Import java.sql.resultset; import java.sql.sqlexception; import java.util.date;

Import com.db.laholsdb; import com.pubfun.fdate; import com.utility.crror; import com.utility.chgdata; import com.utility.schema; import com.utility.stertool Import com..utility.sysconst;

public class LAHolsSchema implements Schema {// @Field / ** coding * / private String AgentCode; / ** * / private String AgentGroup; / ** means * / private String ManageCom; / ** record sequence number * / private int Idx ; / ** Indicator Calculates Code * / Private String Indexcalno; / ** Please leave the Type * / Private String Aclass; / ** Number * / Private Int Vacdays; / ** Date * / Private Date Leavedate; / ** Date * / Private date enddate; / ** Number * / private string absDays; / ** Fill in the flag * / private string fillflag; / ** Certificate Sign * / private string confidenflag; / ** Add Sign * / Private string addvacflag; / * * 号 * / Private Double Summoney; / ** Approved Man * / Private String ApproveCode; / ** Operator Code * / Private String Operator; / * / Private Date makedate; / ** Overhal time * / private string maketime; / ** Last modified date * / private date modifydate; / ** Last modification time * / private string mode; / ** Type * / private string branchtype ; / ** Date * / Private Date Shouldnddate; / ** Status * / Private String Leavestate; / ** External Code * / Private String Branchattr; Public Static Final Int FieldNum = 25; // Database Table Field Number

Private static string [] pk; // master key

Private fdate fdate = new fdate (); // processing date

Public cerors merror; // error message

@Constructor public laholsschema () {MERRORS = New Cerrors ();

String [] pk = new string [2]; pk [0] = "AgentCode"; PK [1] = "idx";

PK = PK;}

@Method public string [] getpk () {return pk;}

public String getAgentCode () {if (AgentCode = null && AgentCode.equals ( "") && SysConst.CHANGECHARSET == true!!) {AgentCode = StrTool.unicodeToGBK (AgentCode);} return AgentCode;} public void setAgentCode (String aAgentCode ) {Agentcode = aagentcode;

public String getAgentGroup () {if (AgentGroup = null && AgentGroup.equals ( "") && SysConst.CHANGECHARSET == true!!) {AgentGroup = StrTool.unicodeToGBK (AgentGroup);} return AgentGroup;}

Public void setagentgroup (string aagentgroup) {agentgroup = aagentgroup;

Public string getManagecom () {if (managecom! = null&&! management.com.equals (") && sysconst.changecharset == true) {managecom = strtool.unicoDetogbk (managecom);} Return ManageCom

Public void setmanagecom (string aManageCom) {managecom = aManageCom;

Public int getidX () {returni IDX;

Public void setidx (int AIDX) {idx = aidx;}

Public void setidx (String Aidx) {IF (AIDX! = Null &&! Aidx.equals (")) {INTEGER TINTEGER = New Integer (AIDX); INT I = Tinteger.intValue (); idx = i;}}

public String getIndexCalNo () {if (IndexCalNo = null && IndexCalNo.equals ( "") && SysConst.CHANGECHARSET == true!!) {IndexCalNo = StrTool.unicodeToGBK (IndexCalNo);} return IndexCalNo;} public void setIndexCalNo (String aIndexCalNo ) {Indexcalno = aindexcalno;

Public string getaclass () {i (aclass! = null&&! aclass.equals (") && sysconst.changecharset == true) {aclass = strtool.unicodetogbk (aclass);} return aclass;}

Public void setaclass (string aaclass) {aclass = aaclass;

Public int getvacdays () {return vacdays;}

Public void setvacdays (int avacdays) {vacdays = avacdays;

Public void setvacdays (string avacdays) {if (avacdays! = null &&! avacdays.equals (")) {integer Tinteger = new integer (avacdays); int i = tinteger.intValue (); vacdays = i;}}

Public string getleavedate () {if (leavedate! = null) {return fdate.getstring (leavedate);} else {return null;}}

Public void setleavedate (date aleavedate) {leavedate = aleavedate;}

Public void setleavedate (string aleavedate) {if (aleavedate! = null&&! aleavedate.equals (")) {leavedate = fdate.getdate (aleavedate);} else {leavedate = null;}}

Public string getenddate () {if (enddate! = null) {return fdate.getstring (enddate);} else {return null;}}}} public void setEnddate (Date Addate) {

Public void setEnddate (String Addate) {if (said) {enddate;} else {enddate = null;}

Public string getabsdays () {if (absdays! = null&&! absdays.equals (") && sysconst.changecharset == true) {absdays = strtool.unicoDetogbk (absdays);} return absdays;}

Public void setabdays (string aabsdays) {absdays = aabsdays;

public String getFillFlag () {if (! FillFlag = null && FillFlag.equals ( "") && SysConst.CHANGECHARSET == true!) {FillFlag = StrTool.unicodeToGBK (FillFlag);} return FillFlag;}

Public void setfillflag (String Afillflag) {FillFlag = AfillFlag;}

public String getConfIdenFlag () {if (! ConfIdenFlag = null && ConfIdenFlag.equals ( "") && SysConst.CHANGECHARSET == true!) {ConfIdenFlag = StrTool.unicodeToGBK (ConfIdenFlag);} return ConfIdenFlag;}

Public void setconfidenflag (string aconfidenflag) {confidenflag = aconfidenflag;

public String getAddVacFlag () {if (AddVacFlag = null && AddVacFlag.equals ( "") && SysConst.CHANGECHARSET == true!!) {AddVacFlag = StrTool.unicodeToGBK (AddVacFlag);} return AddVacFlag;} public void setAddVacFlag (String aAddVacFlag ) {Addvacflag = AADDVACFLAG;

Public Double getSummoney () {Return Summoney;

Public void setsummoney (double asummoney) {summoney = asummoney;

Public void setsummoney (string asummoney) {if (asummoney! = null&&&! asummoney.equals (")) {double tdouble = new double (asummoney); double d = tdouble.doublevalue (); summoney = d;}}

public String getApproveCode () {if (ApproveCode = null && ApproveCode.equals ( "") && SysConst.CHANGECHARSET == true!!) {ApproveCode = StrTool.unicodeToGBK (ApproveCode);} return ApproveCode;}

Public void setApprovecode (string aApprovecode) {approvecode = aApprovecode;

Public string getnoti () {if (noti! = null&&! noti.equals (") && sysconst.changecharset == true) {noti = strtool.unicoDetogbk (noti);} return noti;}

Public void setnoti (string anoti) {noti = anoti;

public String getOperator () {if (Operator = null && Operator.equals ( "") && SysConst.CHANGECHARSET == true!!) {Operator = StrTool.unicodeToGBK (Operator);} return Operator;} public void setOperator (String aOperator ) {Operator = aoperator;

Public string getmakedate () {if (makedate! = null) {return fdate.getstring (Makedate);} else {return null;}}

Public void setmakedate (date amakedate) {Makedate = Amakedate;}

Public void setmakedate (String amakedate) {if (amakedate! = null&&! amakedate.equals (")) {makedate = fdate.getdate (amakedate);} else {makedate = null;}}

Public string getmaketime () {if (Maketime! = null&&! maketime.equals (") && sysconst.changecharset == true) {maketime = strtool.unicodetogbk (maketime);} returnometime;}

Public void setmaketime (string amaketime) {maketime = amaketime;}

Public string getModifyDate () {if (modifydate! = null) {return fdate.getstring (modifydate);} else {return null;}}

Public void setmodifydate (date amodifydate) {modifydate = amodifydate;

public void setModifyDate (String aModifyDate) {if (aModifyDate = null && aModifyDate.equals ( "")!!) {ModifyDate = fDate.getDate (aModifyDate);} else {ModifyDate = null;}} public String getModifyTime () {if (ModifyTime! = Null &&! Modifytime.equals (") && sysconst.changecharset == true) {modifytime = strool.unicoDetogbk (modify);} return model;}

Public void setmodifytime (string amodify) {modifytime = amodifytime;}

public String getBranchType () {if (! BranchType = null && BranchType.equals ( "") && SysConst.CHANGECHARSET == true!) {BranchType = StrTool.unicodeToGBK (BranchType);} return BranchType;}

Public void setbranchType (String AbranchType) {branchtype = AbranchType;}

Public String getSholdDDate () {if (shopnddate! = null) {return fdate.getstring (shouldDate);} else {return null;}}

Public void setSholddenddate (date asholddenddate) {shouldddate = asholddenddate;

public void setShouldEndDate (String aShouldEndDate) {if (aShouldEndDate = null && aShouldEndDate.equals ( "")!!) {ShouldEndDate = fDate.getDate (aShouldEndDate);} else {ShouldEndDate = null;}}

public String getLeaveState () {if (! LeaveState = null && LeaveState.equals ( "") && SysConst.CHANGECHARSET == true!) {LeaveState = StrTool.unicodeToGBK (LeaveState);} return LeaveState;} public void setLeaveState (String aLeaveState ) {LeaveState = aleavestate;

public String getBranchAttr () {if (! BranchAttr = null && BranchAttr.equals ( "") && SysConst.CHANGECHARSET == true!) {BranchAttr = StrTool.unicodeToGBK (BranchAttr);} return BranchAttr;}

Public void setbranchattr (String Abranchattr) {branchattr = Abranchattr;}

/ * ** LAHolsSchema a further object to the use Schema assignment * @param: Schema Object * @return: None ** / public void setSchema (LAHolsSchema aLAHolsSchema) {this.AgentCode = aLAHolsSchema.getAgentCode (); this.AgentGroup = aLAHolsSchema. getAgentGroup (); this.ManageCom = aLAHolsSchema.getManageCom (); this.Idx = aLAHolsSchema.getIdx (); this.IndexCalNo = aLAHolsSchema.getIndexCalNo (); this.AClass = aLAHolsSchema.getAClass (); this.VacDays = aLAHolsSchema. getVacDays (); this.LeaveDate = fDate.getDate (aLAHolsSchema.getLeaveDate ()); this.EndDate = fDate.getDate (aLAHolsSchema.getEndDate ()); this.AbsDays = aLAHolsSchema.getAbsDays (); this.FillFlag = aLAHolsSchema. getFillFlag (); this.ConfIdenFlag = aLAHolsSchema.getConfIdenFlag (); this.AddVacFlag = aLAHolsSchema.getAddVacFlag (); this.SumMoney = aLAHolsSchema.getSumMoney (); this.ApproveCode = aLAHolsSchema.getApproveCode (); this.Noti = aLAHolsS chema.getNoti (); this.Operator = aLAHolsSchema.getOperator (); this.MakeDate = fDate.getDate (aLAHolsSchema.getMakeDate ()); this.MakeTime = aLAHolsSchema.getMakeTime (); this.ModifyDate = fDate.getDate (aLAHolsSchema .getModifyDate ()); this.ModifyTime = aLAHolsSchema.getModifyTime (); this.BranchType = aLAHolsSchema.getBranchType (); this.ShouldEndDate = fDate.getDate (aLAHolsSchema.getShouldEndDate ()); this.LeaveState = aLAHolsSchema.getLeaveState () Id.branchattr = alaholsschema.getbranchattr ();

/ ** * Use the first line in ResultSet * @Param: ResultSet object; i line number * @return: boolean ** / public boolean setschema (ResultSet RS, INT i) {Try {//rs.absolute (i); // Non-rolling cursor IF (rs.getstring ("agecode") == null) {this.Agentcode = null;} else {this.Agentcode = rgenTString ("AgentCode"). Trim (); } IF ("AgentGroup" == null) {this.AgentGroup = null;} else {this.AgentGroup = rs.getstring ("AgentGroup"). Trim ();}

IF ("ManageCom" == null) {this.managecom = null;} else {this.managecom = rs.getstring ("managecom"). Trim ();}

THIS.IDX = rs.getint ("idx"); if (rs.getstring ("indexcalno") == null) {this.indexcalno = null;} else {this.indexcalno = rs.getstring ("indexcalno"). Trim ();

IF (rs.getstring ("aclass") == null) {this.aclass = null;} else {this.aclass = rs.getstring ("aclass"). TRIM ();}

This.vacdays = rs.getInt ("Vacdays"); this.Leavedate = rs.getdate ("LeaveDate"); this.Enddate = rs.getdate ("enddate"); if (rs.getstring ("absdays") = = null) {this.absdays = null;} else {this.absdays = rs.getstring ("absdays"). Trim ();} if (rs.getstring ("fillflag") == null) {this.FillFlag = null;} else {this.fillflag = rs.getstring ("fillflag"). Trim ();

IF ("confidenflag") == null) {this.confidenflag = null;} else {this.confidenflag = rs.getstring ("confidenflag"). TRIM ();}

IF ("addvacflag") == null) {this.addvacflag = null;} else {this.addvacflag = rs.getstring ("addvacflag"). TRIM ();}

This.Summoney = rs.getdouble ("Summoney"); if ("approvecode" == null) {this.approvecode = null;} else {this.approvecode = rs.getstring ("ApproveCode"). Trim ();

IF (rs.getstring ("noti") == null) {this.noti = null;} else {this.noti = rgetstring ("noti"). Trim ();}

IF ("Operator") == NULL) {this.operator = null;} else {this.operator = rs.getstring ("operator"). Trim ();} this.makedate = rs.getdate "Makedate"); if (rs.getstring ("maketime") == null) {this.maketime = null;} else {this.maketime = r g gTString ("maketime"). Trim ();}

THIS.MODIFYDATE = rs.getdate ("modifydate"); if (rs.getstring ("modifytime") == null) {this.modifytime = null;} else {this.modifytime = rs.getstring ("ModifyTime"). Trim ();

IF ("BranchType" == null) {this.branchType = null;} else {this.branchtype = rs.getstring ("branchtype"). Trim ();}

THIS.SHOULDENDDATE = rs.getdate ("ShouldDate"); if (rs.getstring ("leavestate" == null) {this.leavestate = null;} else {this.Leavestate = rgetstring ("leavestate"). Trim ();

IF ("branchattr" == null) {this.branchattr = null;} else {this.branchattr = rs.getstring ("branchattr"). Trim ();}

} Catch (SQLEXCEPTION SQLE) {@@ 错误 处理 CERROR TERROR = New Cerror (); TERROR.ModulenAme = "laholsschema"; terror.functionName = "setschema"; terror.errorMessage = SQLE.TOSTOSTRING (); this.merror .addoneError (TEERROR); RETURN FALSE;} Return True;

Public laholsschema getschema () {laholsschema alaholsschema = new laholsschema (); Alaholsschema.Setschema (this); Return AlaholssChema;}

Public laholsdb getdb () {laholsdb adboper = new laholsdb (); adboper.setschema (this); return adboper;}

/ ** * Data package, packed in XML format, see table field * @Param: None * @return: Return the packaged string ** / public String encode () {String strReturn = ""; strReturn = StrTool.cTrim (StrTool.unicodeToGBK (AgentCode)) SysConst.PACKAGESPILTER StrTool.cTrim (StrTool.unicodeToGBK (agentGroup)) SysConst.PACKAGESPILTER StrTool .cTrim (StrTool.unicodeToGBK (ManageCom)) SysConst.PACKAGESPILTER ChgData.chgData (Idx) SysConst.PACKAGESPILTER StrTool.cTrim (StrTool.unicodeToGBK (IndexCalNo)) SysConst.PACKAGESPILTER StrTool.cTrim (StrTool.unicodeToGBK ( ACLASS)) Sysconst.PackagesPilter chgdata.chgdata (VACDAYS) Sysconst.PackagesPilter STRTOOL.CTRIM (STRTOOL.UNICOGBK (fdate.getstring LeaveDate))) SysConst.PACKAGESPILTER StrTool.cTrim (StrTool.unicodeToGBK (fDate.getString (EndDate))) SysConst.PACKAGESPILTER StrTool.cTrim (StrTool.unicodeToGBK (AbsDays)) SysConst.PACKAGESPILTER StrTool.cTrim ( STRTOOL.UNICODETOGBK (FillFlag)) Sysconst.PackagesPilter STRTOOL.CTRIM (STRTOOL.UNICOGBK (Confidenflag)) Sysconst.PackageSpilter

StrTool.cTrim (StrTool.unicodeToGBK (AddVacFlag)) SysConst.PACKAGESPILTER ChgData.chgData (SumMoney) SysConst.PACKAGESPILTER StrTool.cTrim (StrTool.unicodeToGBK (ApproveCode)) SysConst.PACKAGESPILTER StrTool.cTrim (StrTool.unicodeToGBK (Noti)) SysConst.PACKAGESPILTER StrTool.cTrim (StrTool.unicodeToGBK (Operator)) SysConst.PACKAGESPILTER StrTool.cTrim (StrTool.unicodeToGBK (fDate.getString (MakeDate))) SysConst.PACKAGESPILTER StrTool.cTrim ( StrTool.unicodeToGBK (MakeTime)) SysConst.PACKAGESPILTER StrTool.cTrim (StrTool.unicodeToGBK (fDate.getString (ModifyDate))) SysConst.PACKAGESPILTER StrTool.cTrim (StrTool.unicodeToGBK (Modif yTime)) SysConst.PACKAGESPILTER StrTool.cTrim (StrTool.unicodeToGBK (BranchType)) SysConst.PACKAGESPILTER StrTool.cTrim (StrTool.unicodeToGBK (fDate.getString (ShouldEndDate))) SysConst.PACKAGESPILTER StrTool.cTrim (StrTool .unicodetogbk (leavestate)) Sysconst.PackagesPilter STRTOOL.CTRIM (STRTOOL.UNICODETOGBK (BRANCHATTR)); Return Strreturn;}

/ ** * Data unpack, unpacking order See History Credential Certificate The homekess information table field * @Param: StrMessage: Contains a record data string * @return: boolean ** / public boolean decode (string strMessage) {try {AgentCode = StrTool.getStr (StrTool.GBKToUnicode (strMessage), 1, SysConst.PACKAGESPILTER); agentGroup = StrTool.getStr (StrTool .GBKToUnicode (strMessage), 2, SysConst.PACKAGESPILTER); ManageCom = StrTool.getStr (StrTool.GBKToUnicode (strMessage), 3, SysConst.PACKAGESPILTER); Idx = new Integer (ChgData.chgNumericStr (StrTool.getStr (strMessage, 4, . SysConst.PACKAGESPILTER))) intValue (); IndexCalNo = StrTool.getStr (StrTool.GBKToUnicode (strMessage), 5, SysConst.PACKAGESPILTER); AClass = StrTool.getStr (StrTool.GBKToUnicode (strMessage), 6, SysConst.PACKAGESPILTER); VacDays = new Integer (ChgData.chgNumericStr (StrTool.getStr (strMessage, 7, SysConst.PACKAGESPILTER))) intValue ();. LeaveDate = fDate.getDate (StrTool.getStr (StrTool.GBKToUnicode (strMessage), 8, SysConst.PACKAGESPILTER)); EndDate = fDate.getDate (StrTool.getStr (StrTool.GBKToUnicode (strMessage), 9, SysConst.PACKAGESPILTER)); AbsDays = StrTool.getStr (StrTool.GBKToUnicode (strMessage), 10, SysConst. PackageSpilter; FillFlag =

StrTool.getStr (StrTool.GBKToUnicode (strMessage), 11, SysConst.PACKAGESPILTER); ConfIdenFlag = StrTool.getStr (StrTool.GBKToUnicode (strMessage), 12, SysConst.PACKAGESPILTER); AddVacFlag = StrTool.getStr (StrTool.GBKToUnicode (strMessage) , 13, SysConst.PACKAGESPILTER);. SumMoney = new Double (ChgData.chgNumericStr (StrTool.getStr (strMessage, 14, SysConst.PACKAGESPILTER))) doubleValue (); ApproveCode = StrTool.getStr (StrTool.GBKToUnicode (strMessage), 15 , SysConst.PACKAGESPILTER); Noti = StrTool.getStr (StrTool.GBKToUnicode (strMessage), 16, SysConst.PACKAGESPILTER); Operator = StrTool.getStr (StrTool.GBKToUnicode (strMessage), 17, SysConst.PACKAGESPILTER); MakeDate = fDate. GetDate StrTool.getStr (StrTool.GBKToUnicode (strMessage), 18, SysConst.PACKAGESPILTER)); MakeTime = StrTool.getStr (StrTool.GBKToUnicode (strMessage), 19, SysConst.PACKAGESPILTER); ModifyDate = fDate.getDate (StrTool.getStr (StrTool .GBKToUnicode (strMessage), 20, SysConst.PACKAGESPILTER)); modifyTime = StrTool.getStr (StrTool.GBKToUnicode (strMessage), 21, SysConst.PACKAGESPILTER); BranchType = StrTool.getStr (StrTool.GBKToUnicode (strMessage), 22, SysConst .Packagespilter; ShouldEnddate =

fDate.getDate (StrTool.getStr (StrTool.GBKToUnicode (strMessage), 23, SysConst.PACKAGESPILTER)); LeaveState = StrTool.getStr (StrTool.GBKToUnicode (strMessage), 24, SysConst.PACKAGESPILTER); BranchAttr = StrTool.getStr (StrTool .GBKToUnicode (strMessage), 25, SysConst.PACKAGESPILTER);} catch (NumberFormatException ex) {// @@ error handling CError tError = new CError (); tError.moduleName = "LAHolsSchema"; tError.functionName = "decode"; Terror.ErrorMessage = ex.Tostring (); this.merrors.addoneError (TERROR); RETURN FALSE;} Return true;}

/ ** * String Field value of the corresponding Parameter * @Param: fcode hopes to get the field name * @return: FValue String form Field value * fValue = "" No matching field * Fvalue = "null" Field value is null ** / public string getv (string fcode) {string strreturn = ""; if (fcode.equals ("agecode") {strreturn = strtool.gbktounicode (Strreturn.Valueof (AgentCode));} IF FCode.equals ( "agentGroup")) {strReturn = StrTool.GBKToUnicode (strReturn.valueOf (agentGroup));} if (FCode.equals ( "ManageCom")) {strReturn = StrTool.GBKToUnicode (strReturn.valueOf (ManageCom)) ;} if (FCode.equals ( "Idx")) {strReturn = StrTool.GBKToUnicode (strReturn.valueOf (Idx));} if (FCode.equals ( "IndexCalNo")) {strReturn = StrTool.GBKToUnicode (strReturn.valueOf (Indexcalno);} if (fcode.equals ("acvel")) {strreturn = strtool.gbktounicode (Strreturn.Valueof (acvel)); } If (FCode.equals ( "VacDays")) {strReturn = StrTool.GBKToUnicode (strReturn.valueOf (VacDays));} if (FCode.equals ( "LeaveDate")) {strReturn = StrTool.GBKToUnicode (strReturn.valueOf ( . Getleavedate ());} if (fcode.equals ("enddate")) {strreturn = strtool.gbktounicode (Strreturn.Valueof (this.Getenddate ());} if (fcode.equals ("absdays") ) {Strreturn = STRTOOL.GBKTOUNICODE (Strreturn.Valueof (absdays));

} If (FCode.equals ( "FillFlag")) {strReturn = StrTool.GBKToUnicode (strReturn.valueOf (FillFlag));} if (FCode.equals ( "ConfIdenFlag")) {strReturn = StrTool.GBKToUnicode (strReturn.valueOf ( ConfIdenFlag));} if (FCode.equals ( "AddVacFlag")) {strReturn = StrTool.GBKToUnicode (strReturn.valueOf (AddVacFlag));} if (FCode.equals ( "SumMoney")) {strReturn = StrTool.GBKToUnicode ( strReturn.valueOf (SumMoney));} if (FCode.equals ( "ApproveCode")) {strReturn = StrTool.GBKToUnicode (strReturn.valueOf (ApproveCode));} if (FCode.equals ( "Noti")) {strReturn = STRTOOL.GBKTOUNICODE (STRRETURN.Valueof (noti));} if (fcode.equals ("operator")) {strreturn = strtool.gbktounicode (Strreturn.Valueof (Operator));} if (fcode.equals ("makedate") ) {Strreturn = strool.gbktouni code (strReturn.valueOf (this.getMakeDate ()));} if (FCode.equals ( "MakeTime")) {strReturn = StrTool.GBKToUnicode (strReturn.valueOf (MakeTime));} if (FCode.equals ( "ModifyDate ")) {strReturn = StrTool.GBKToUnicode (strReturn.valueOf (this getModifyDate (.)));} if (FCode.equals (" modifyTime ")) {strReturn = StrTool.GBKToUnicode (strReturn.valueOf (modifyTime));} IF (fcode.equals ("branchtype")) {strreturn =

StrTool.GBKToUnicode (strReturn.valueOf (BranchType));} if (FCode.equals ( "ShouldEndDate")) {strReturn = StrTool.GBKToUnicode (strReturn.valueOf (this getShouldEndDate ()).);} If (FCode.equals ( "LeaveState")) {strReturn = StrTool.GBKToUnicode (strReturn.valueOf (LeaveState));} if (FCode.equals ( "BranchAttr")) {strReturn = StrTool.GBKToUnicode (strReturn.valueOf (BranchAttr));} if ( Strreturn.equals (")) {strreturn =" null ";} return strreturn;}

/ ** * Take the field value corresponding to the specified index value in Schema * @Param: nfieldIndIndex specified by the field index value * @return: field value.

* If there is no corresponding field, return "" If the field value is empty, return "null" ** / public string getv (int nfieldIndex) {string string stringvalue = ""; switch (nfieldIndex) {case 0: strfieldValue = STRTOOL. GBKToUnicode (AgentCode); break; case 1: strFieldValue = StrTool.GBKToUnicode (agentGroup); break; case 2: strFieldValue = StrTool.GBKToUnicode (ManageCom); break; case 3: strFieldValue = String.valueOf (Idx); break; case 4: strFieldValue = StrTool.GBKToUnicode (IndexCalNo); break; case 5: strFieldValue = StrTool.GBKToUnicode (AClass); break; case 6: strFieldValue = String.valueOf (VacDays); break; case 7: strFieldValue = StrTool.GBKToUnicode ( String.valueof (this. getLeaveDate ())); break; case 8: strFieldValue = StrTool.GBKToUnicode (String.valueOf (this getEndDate (.))); break; case 9: strFieldValue = StrTool.GBKToUnicode (AbsDays); break; case 10: strFieldValue = STRTOOL.GBKTOUNICODE (FillFlag); Break; Case 11: StrfieldValue = strtool.gbktounicore (confidenflag); Break; Case 12: StrfieldValue = strtool.gbktounicode (addvacflag); Break;

case 13: strFieldValue = String.valueOf (SumMoney); break; case 14: strFieldValue = StrTool.GBKToUnicode (ApproveCode); break; case 15: strFieldValue = StrTool.GBKToUnicode (Noti); break; case 16: strFieldValue = StrTool.GBKToUnicode (Operator); break; case 17: strFieldValue = StrTool.GBKToUnicode (String.valueOf (this getMakeDate ()).); break; case 18: strFieldValue = StrTool.GBKToUnicode (MakeTime); break; case 19: strFieldValue = StrTool. GBKTOUNICODE (String.Valueof (this. GetModifyDate ())); break; case 20: strfieldvalue = strup.gbktounicode (modifytime); break; cas 21: strfieldvalue = strool.gbktounicode anchType); break; case 22: strFieldValue = StrTool.GBKToUnicode (String.valueOf (this getShouldEndDate ().)); break; case 23: strFieldValue = StrTool.GBKToUnicode (LeaveState); break; case 24: strFieldValue = StrTool.GBKToUnicode (BRANCHATTR); BREAK; Default: strfieldvalue = "";}; if (strfieldValue.equals (")) {strfieldValue =" null ";} return strfieldValue;}

/ ** * Set the field value of the String form corresponding to the incoming parameter * @Param: Fcode hopes to get the field name * @return: FVALUE STRING Field value * Fvalue = "" No matching field * Fvalue = "null" Field values ​​are null ** / public boilean setv (string fcode, string fvalue) {if (string.ctrim (fcode) .Equals (")) {returnaf false;}

IF ("AgentCode")) {if (FValue! = Null &&! Fvalue.Equals (")) {agentcode = fvalue.trim ();} else {agentcode = null;}}} f (fcode) Equals ("AgentGroup")) {if (FValue! = Null &&! Fvalue.equals (")) {agentgroup = fvalue.trim ();} else {agentgroup = null;}}} (fcode.equals) ")) {If (FValue! = Null&&! Fvalue.equals (")) {managecom = fvalue.trim ();} else {managecom = null;}}} f (fcode.equals ("iDX")) { IF (FValue! = Null &&! Fvalue.equals (")) {integer tinteger = new integer (fvalue); int i = tinteger.intValue (); idx = i;} } F ("indexcalno") {if (Fvalue! = Null&&! Fview.equals (")) {indexcalno = fvalue.trim ();} else {indexcalno = null;}} if (fcode) . Equals ("ACLASS")) {if (Fvalue! = Null &&! Fvalue.Equals (")) {aclass = fvalue.trim ();} else {aclass = null;}}} f ("

Vacdays ")) {if (FValue! = Null &&! Fvalue.equals (")) {Integer Tinteger = new integer (fvalue); int i = tinteger.intValue (); vacdays = i;}} = Equals ("LeaveDate")) {if (Fvalue! = Null &&! Fvalue.equals (")) {LeaveDate = fdate.getdate (} else {leavedate = null;}}}} (fcode.equals) Enddate ")) {if (FValue! = Null &&! FValue.equals (")) {enddate = fdate.getdate (flash});} else {enddate = null;}}}}; "absdays") ) {If (FValue! = Null&&! Fview.equals (")) {absdays = fvalue.trim ();} else {absDays = null;}} IF (Fcode.equals ("FVALUE! = Null &&! Fvalue.equals (")) {FillFlag = FVALUE.TRIM () Else {FillFlag = null;}}} Equals ("confidenflag")) {if (FValue! = null&&! fValue.equals (")) {confidenflag = fvalue.trim ();} else {confidenflag = null;}}} (fcode.equals)

Addvacflag ") {if (FValue! = Null&&! Fview.equals (")) {addvacflag = fvalue.trim ();} else {addvacflag = null;}}} ("Summoney)) {IF (FValue! = Null &&! Fvalue.equals (")) {double tdouble = new double (fvalue); double d = tdouble.doublevalue (); summoney = d;}}}}}} ")) {If (FValue! = Null&&! Fview.equals (")) {approvecode = fvalue.trim ();} else {approvecode = null;}}}}) { IF (FValue! = Null &&! FValue.equals (")) {NOTI = fValue.trim ();} else {noti = null;}} = Fcode.equals ("Operator")) {if (Fvalue! = Null &&! Fvalue.Equals (")) {Operator = fvalue.trim ();} else {operator = null;}}} f (fcode.equals "Makedate")) {if (FValue! = Null&&! FValue.equals (")) {MakeDate = fdate.getdate (fValue);} else {makedate = null;}}} f (fcode.equals)

Maketime ")) {if (FValue! = Null&&! Fvalue.equals (")) {maketime = fvalue.trim ();} else {maketime = null;}} f (fcode.equals ("modifydate)) {IF (FValue! = Null &&! Fvalue.equals (")) {modifydate = fdate.getdate (fview);} else {modifydate = null;}}} f (fcode.equals (" modifytime ") {IF FValue! = Null&&! Fview.equals (")) {modifytime = fvalue.trim ();} else {modifytime = null;}}}} (fcode.equals (" branchtype ")) {if (Fvalue! = Null &&! Fview.equals (")) {branchtype = fvalue.trim ();} else {branchtype = null;}} IF (Fcode.equals ("ShouldEnddate")) {if (Fvalue! = Null &&! Fvalue.Equals (")) {ShouldDDate = fdate.getdate (fview});} else {ShouldEndDate = null;}}}}} {if (FValue! = Null &&! Fvalue.equals (")) {LeaveState = FVALUE.TRIM ();} else {willopy

}}}} ("Branchattr")) {if (Fvalue! = Null &&! Fview.equals (")) {branchattr = fValue.trim ();} else {branchattr = null;}} returntr = null;}} return }

public boolean equals (Object otherObject) {if (this == otherObject) {return true;} if (otherObject == null) {return false;} if (! getClass () = otherObject.getClass ()) {return false;} LAHolsSchema other = (LAHolsSchema) otherObject; return AgentCode.equals (other.getAgentCode ()) && AgentGroup.equals (other.getAgentGroup ()) && ManageCom.equals (other.getManageCom ()) && Idx == other.getIdx () && IndexCalNo.equals (other.getIndexCalNo ()) && AClass.equals (other.getAClass ()) && VacDays == other.getVacDays () && fDate.getString (LeaveDate) .equals (other.getLeaveDate ()) && fDate. GetString (Enddate) .Equals (Other.Getenddate () && AbsDays () && Fillflag.equals (Other.Getfillflag () && confial IdenFlag.equals (other.getConfIdenFlag ()) && AddVacFlag.equals (other.getAddVacFlag ()) && SumMoney == other.getSumMoney () && ApproveCode.equals (other.getApproveCode ()) && Noti.equals (other.getNoti ( )) && operator.equals (Other.getoperator () .Equals (Other.getmakeDate () && Maketime.Equals (Other.getmaketime () && fdate.getstring (ModifyDate) .Equals .Equals. Other.getmodifyDate ()) &&

ModifyTime.equals (other.getModifyTime ()) && BranchType.equals (other.getBranchType ()) && fDate.getString (ShouldEndDate) .equals (other.getShouldEndDate ()) && LeaveState.equals (other.getLeaveState ()) && BranchAttr } / ** * Get the number of Schema owners with fields ** / public int getfieldcount () {Return Fieldnum;}

/ ** * Obtain the index value corresponding to the specified field name in Schema * If there is no corresponding field, return -1 ** / public int getfieldindex (string strfieldname) {if (StrfieldName.Equals ("AgentCode") {Return 0; } IF ("AgentName.Equals (" AgentGroup ")) {RETURN 1;} if (StrfieldName.Equals (" ManageCom ")) {Return 2;} if (StrfieldName.Equals (" iDX ")) {Return 3;} IF (StrfieldName.equals ("indexcalno")) {return 4;} if (strfieldname.equals ("acfieldname.equals (strfieldname.equals (" vacdays ")) {Return 6;} if (StrfieldName . Equals ("LeaveDate")) {RETURN 7;} if (StrfieldName.Equals ("enddate")) {Return 8;} if (strfieldname.equals ("absdays") {Return 9;} if (strfieldname.equals ("FillFlag")) { Return 10;} if ("confidenflag")) {RETURN 11;} IF (StrfieldName.Equals ("addvacflag")) {RETURN 12;} if (strfieldname.equals ("summoney)) {Return 13 }} {RETURN 14;} if (StrfieldName.Equals ("noti")) {Return 15;} (StrfieldName.Equals ("Operator")) {Return 16;} IF (StrfieldName.equals ("Makedate"

)) {RETURN 17;} if (strfieldname.equals ("maketime")) {RETURN 18;} if (strfieldname.equals ("modifydate")) {Return 19;} if (StrfieldName.Equals ("modifytime)) {RETURN 20;} IF ("BranchType")) {RETURN 21;} if (StrfieldName.equals ("ShouldEnddate")) {Return 22;} IF (StrfieldName.Equals ("LeaveState)) {Return 23;} IF (strfieldname.equals ("branchtr")) {RETURN 24;} Return -1;}

/ ** * Field name corresponding to specified index values ​​in Schema * If there is no corresponding field, return "" ** / public string getfieldname (int nfieldindex) {string string stringname = ""; switch (nfieldIndex) {case 0: strFieldName = "AgentCode"; break; case 1: strFieldName = "agentGroup"; break; case 2: strFieldName = "ManageCom"; break; case 3: strFieldName = "Idx"; break; case 4: strFieldName = "IndexCalNo"; break; case 5: strFieldName = "AClass"; break; case 6: strFieldName = "VacDays"; break; case 7: strFieldName = "LeaveDate"; break; case 8: strFieldName = "EndDate"; break; case 9: strFieldName = "Absdays"; break; case 10: strFieldName = "FillFlag"; break; case 11: strFieldName = "ConfIdenFlag"; break; case 12: strFieldName = "AddVacFlag"; break; case 13: strFieldName = "SumMoney"; break; case 14: strFieldName = "ApproveCode"; Break; Case 15: StrfieldName = "noti"; Break;

case 16: strFieldName = "Operator"; break; case 17: strFieldName = "MakeDate"; break; case 18: strFieldName = "MakeTime"; break; case 19: strFieldName = "ModifyDate"; break; case 20: strFieldName = " modifyTime "; break; case 21: strFieldName =" BranchType "; break; case 22: strFieldName =" ShouldEndDate "; break; case 23: strFieldName =" LeaveState "; break; case 24: strFieldName =" BranchAttr "; break; default : Strfieldname = "";}; return strfieldname;}

/ ** * Type of field type corresponding to the specified field name in Schema * If there is no corresponding field, return schema.type_nofound ** / public int getfieldType (StrfieldName.Equals ("Agentcode") {Return Schema .TYPE_STRING;} if (strFieldName.equals ( "agentGroup")) {return Schema.TYPE_STRING;} if (strFieldName.equals ( "ManageCom")) {return Schema.TYPE_STRING;} if (strFieldName.equals ( "Idx") ) {return Schema.TYPE_INT;} if (strFieldName.equals ( "IndexCalNo")) {return Schema.TYPE_STRING;} if (strFieldName.equals ( "AClass")) {return Schema.TYPE_STRING;} if (strFieldName.equals ( "Vacdays")) {return schema.type_int;} if ("LeaveDate") {return schema.type_date;} if (StrfieldName.Equals ("enddate") {Return Schema. TYPE_DATE;} if (strFieldName.equals ( "AbsDays")) {return Schema.TYPE_STRING;} if (strFieldName.equals ( "FillFlag")) {return Schema.TYPE_STRING;} if (strFieldName.equals ( "ConfIdenFlag")) {return Schema.TYPE_STRING;} if (strFieldName.equals ( "AddVacFlag")) {return Schema.TYPE_STRING;} if (strFieldName.equals ( "SumMoney")) {return Schema.TYPE_DOUBLE;} if (strFieldName.equals ( " ApproveCode ")) {returnch schema.type_string;

} If (strFieldName.equals ( "Noti")) {return Schema.TYPE_STRING;} if (strFieldName.equals ( "Operator")) {return Schema.TYPE_STRING;} if (strFieldName.equals ( "MakeDate")) {return Schema.TYPE_DATE;} if (strFieldName.equals ( "MakeTime")) {return Schema.TYPE_STRING;} if (strFieldName.equals ( "ModifyDate")) {return Schema.TYPE_DATE;} if (strFieldName.equals ( "modifyTime" )) {return Schema.TYPE_STRING;} if (strFieldName.equals ( "BranchType")) {return Schema.TYPE_STRING;} if (strFieldName.equals ( "ShouldEndDate")) {return Schema.TYPE_DATE;} if (strFieldName.equals ("LeaveState") {return schema.type_string;}}} (StrfieldName.Equals ("branchattr")) {return schema.type_string; } Return Schema.Type_nofound;}

/ ** * index value to obtain the specified field type corresponding to the Schema * If there is no corresponding field, returns Schema.TYPE_NOFOUND ** / public int getFieldType (int nFieldIndex) {int nFieldType = Schema.TYPE_NOFOUND; switch (nFieldIndex) {case 0: nFieldType = Schema.TYPE_STRING; break; case 1: nFieldType = Schema.TYPE_STRING; break; case 2: nFieldType = Schema.TYPE_STRING; break; case 3: nFieldType = Schema.TYPE_INT; break; case 4: nFieldType = Schema. TYPE_STRING; break; case 5: nFieldType = Schema.TYPE_STRING; break; case 6: nFieldType = Schema.TYPE_INT; break; case 7: nFieldType = Schema.TYPE_DATE; break; case 8: nFieldType = Schema.TYPE_DATE; break; case 9: nFieldType = Schema.TYPE_STRING; break; case 10: nFieldType = Schema.TYPE_STRING; break; case 11: nFieldType = Schema.TYPE_STRING; break; case 12: nFieldType = Schema.TYPE_STRING; break; case 13: nFieldType = Schema .TYPE_DOUBLE; BREAK; CASE 14: nfieldType = schema.type_string; break; case 15: nfieldtype = schema.type_string;

转载请注明原文地址:https://www.9cbs.com/read-42978.html

New Post(0)