pacozaa

cgdfasdfafa

Oct 19th, 2015
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.34 KB | None | 0 0
  1. package cgd.sec.data;
  2.  
  3. import cgd.ref.data.StatusInfo;
  4. import cgd.ref.data.Title;
  5.  
  6. import cgd.util.DateConvert;
  7.  
  8. import java.io.Serializable;
  9.  
  10. import java.sql.Timestamp;
  11.  
  12. import java.text.SimpleDateFormat;
  13.  
  14. import java.util.Date;
  15. import java.util.List;
  16. import java.util.Locale;
  17.  
  18. import javax.persistence.Column;
  19. import javax.persistence.Entity;
  20. import javax.persistence.Id;
  21. import javax.persistence.JoinColumn;
  22. import javax.persistence.ManyToOne;
  23. import javax.persistence.NamedQueries;
  24. import javax.persistence.NamedQuery;
  25. import javax.persistence.OneToMany;
  26. import javax.persistence.Table;
  27. import javax.persistence.Temporal;
  28. import javax.persistence.TemporalType;
  29. import javax.persistence.Transient;
  30.  
  31. @Entity
  32. @NamedQueries(
  33. {
  34. @NamedQuery(name = "UserInfo.findAll", query = "select o from UserInfo o")
  35. })
  36. @Table(name = "SEC_USER_INFO")
  37. public class UserInfo
  38. implements Serializable
  39. {
  40. private static final long serialVersionUID = -7641485433085072800L;
  41. @Column(length = 300)
  42. private String address;
  43. private Integer approvedocstatus;
  44. private Integer approveleavestatus;
  45. @Column(nullable = false)
  46. private Integer birthdate;
  47. @Column(nullable = false, length = 13)
  48. private String cardid;
  49. private Integer considerstatus;
  50. //@Temporal(TemporalType.DATE)
  51. @Column(nullable = false)
  52. private Timestamp datecreated;
  53. //@Temporal(TemporalType.DATE)
  54. private Timestamp dateupdated;
  55. @Column(nullable = false, length = 1)
  56. private String disabledindicator;
  57. @Column(nullable = false)
  58. private Integer entrydate;
  59. private Integer finishdate;
  60. @Column(nullable = false, length = 50)
  61. private String firstname;
  62. @Column(nullable = false)
  63. private String gender;
  64. @Column(nullable = false)
  65. private String hadj;
  66. @Column(length = 50)
  67. private String ipaddress;
  68. @Column(nullable = false, length = 50)
  69. private String lastname;
  70. private Integer logincount;
  71. @Column(nullable = false)
  72. private String marriage;
  73. @Column(nullable = false)
  74. private String ordain;
  75. private Integer organizeid;
  76. @Column(length = 128)
  77. private String password;
  78. @Column(length = 30)
  79. private String phoneno;
  80. @Column(length = 6)
  81. private String positionid;
  82. @Column(nullable = false)
  83. private byte recordstatus;
  84. @Column(nullable = false)
  85. private String religion;
  86. @Column(nullable = false)
  87. private Integer retiredate;
  88. @Column(length = 20)
  89. private String screenid;
  90. private Integer startdate;
  91. @Column(length = 3)
  92. private String statusid;
  93. @Column(length = 3)
  94. private String titleid;
  95. @Column(length = 10)
  96. private String usercode;
  97. @Id
  98. @Column(nullable = false, length = 10)
  99. private String userid;
  100. @Column(nullable = false, length = 10)
  101. private String useridcreated;
  102. @Column(length = 10)
  103. private String useridupdated;
  104. private Integer userlevel;
  105. private String usertype;
  106. private Integer workorganizeid;
  107. @Transient
  108. private int officialageyear;
  109. @Transient
  110. private int officialagemonth;
  111. @Transient
  112. private int officialageday;
  113. @Transient
  114. private int totalannualleave;
  115.  
  116. @OneToMany(mappedBy = "userInfo")
  117. private List<UserRole> userRoleList;
  118.  
  119. @ManyToOne()
  120. @JoinColumn(name="USERIDUPDATED", insertable=false, updatable=false, nullable=false)
  121. private UserInfo useridupdatedInfo;
  122.  
  123. @ManyToOne()
  124. @JoinColumn(name="titleid", insertable=false, updatable=false, nullable=false)
  125. private Title title;
  126.  
  127. @ManyToOne()
  128. @JoinColumn(name="organizeid",referencedColumnName = "organizeid", insertable=false, updatable=false, nullable=false)
  129. private OrganizeInfo organizeInfo;
  130.  
  131. @ManyToOne()
  132. @JoinColumn(name="workorganizeid",referencedColumnName = "organizeid", insertable=false, updatable=false, nullable=false)
  133. private OrganizeInfo workorganizeInfo;
  134.  
  135. @ManyToOne()
  136. @JoinColumn(name="statusid", insertable=false, updatable=false, nullable=false)
  137. private StatusInfo statusInfo;
  138.  
  139. public UserInfo()
  140. {
  141. }
  142.  
  143. public UserInfo(String address, Integer approvedocstatus, Integer approveleavestatus, Integer birthdate,
  144. String cardid, Integer considerstatus, Timestamp datecreated, Timestamp dateupdated, String disabledindicator,
  145. Integer entrydate, Integer finishdate, String firstname, String gender, String hadj, String ipaddress,
  146. String lastname, Integer logincount, String marriage, String ordain, Integer organizeid,
  147. String password, String phoneno, String positionid, byte recordstatus, String religion,
  148. Integer retiredate, String screenid, Integer startdate, String statusid, String titleid,
  149. String usercode, String userid, String useridcreated, String useridupdated, Integer userlevel,
  150. String usertype, Integer workorganizeid)
  151. {
  152. this.address = address;
  153. this.approvedocstatus = approvedocstatus;
  154. this.approveleavestatus = approveleavestatus;
  155. this.birthdate = birthdate;
  156. this.cardid = cardid;
  157. this.considerstatus = considerstatus;
  158. this.datecreated = datecreated;
  159. this.dateupdated = dateupdated;
  160. this.disabledindicator = disabledindicator;
  161. this.entrydate = entrydate;
  162. this.finishdate = finishdate;
  163. this.firstname = firstname;
  164. this.gender = gender;
  165. this.hadj = hadj;
  166. this.ipaddress = ipaddress;
  167. this.lastname = lastname;
  168. this.logincount = logincount;
  169. this.marriage = marriage;
  170. this.ordain = ordain;
  171. this.organizeid = organizeid;
  172. this.password = password;
  173. this.phoneno = phoneno;
  174. this.positionid = positionid;
  175. this.recordstatus = recordstatus;
  176. this.religion = religion;
  177. this.retiredate = retiredate;
  178. this.screenid = screenid;
  179. this.startdate = startdate;
  180. this.statusid = statusid;
  181. this.titleid = titleid;
  182. this.usercode = usercode;
  183. this.userid = userid;
  184. this.useridcreated = useridcreated;
  185. this.useridupdated = useridupdated;
  186. this.userlevel = userlevel;
  187. this.usertype = usertype;
  188. this.workorganizeid = workorganizeid;
  189. }
  190.  
  191. public String getAddress()
  192. {
  193. return address;
  194. }
  195.  
  196. public void setAddress(String address)
  197. {
  198. this.address = address;
  199. }
  200.  
  201. public Integer getApprovedocstatus()
  202. {
  203. return approvedocstatus;
  204. }
  205.  
  206. public void setApprovedocstatus(Integer approvedocstatus)
  207. {
  208. this.approvedocstatus = approvedocstatus;
  209. }
  210.  
  211. public Integer getApproveleavestatus()
  212. {
  213. return approveleavestatus;
  214. }
  215.  
  216. public void setApproveleavestatus(Integer approveleavestatus)
  217. {
  218. this.approveleavestatus = approveleavestatus;
  219. }
  220.  
  221. public Integer getBirthdate()
  222. {
  223. return birthdate;
  224. }
  225.  
  226. public String getBirthdateDisplay()
  227. {
  228. String vaRtn = "";
  229. if(this.birthdate != null)
  230. {
  231. vaRtn = DateConvert.storeDate2DisplayDate(String.valueOf(this.birthdate));
  232. }
  233. return vaRtn;
  234. }
  235.  
  236. public void setBirthdate(Integer birthdate)
  237. {
  238. this.birthdate = birthdate;
  239. }
  240.  
  241. public String getCardid()
  242. {
  243. return cardid;
  244. }
  245.  
  246. public void setCardid(String cardid)
  247. {
  248. this.cardid = cardid;
  249. }
  250.  
  251. public Integer getConsiderstatus()
  252. {
  253. return considerstatus;
  254. }
  255.  
  256. public void setConsiderstatus(Integer considerstatus)
  257. {
  258. this.considerstatus = considerstatus;
  259. }
  260.  
  261. public Timestamp getDatecreated()
  262. {
  263. return datecreated;
  264. }
  265.  
  266. public void setDatecreated(Timestamp datecreated)
  267. {
  268. this.datecreated = datecreated;
  269. }
  270.  
  271. public Timestamp getDateupdated()
  272. {
  273. return dateupdated;
  274. }
  275.  
  276. public String getDateupdatedDisplay()
  277. {
  278. String vaRtn = "";
  279.  
  280. if(this.dateupdated != null)
  281. {
  282. vaRtn = DateConvert.convTimestamp2String(this.dateupdated);
  283. }
  284. return vaRtn;
  285. }
  286.  
  287. public void setDateupdated(Timestamp dateupdated)
  288. {
  289. this.dateupdated = dateupdated;
  290. }
  291.  
  292. public String getDisabledindicator()
  293. {
  294. return disabledindicator;
  295. }
  296.  
  297. public void setDisabledindicator(String disabledindicator)
  298. {
  299. this.disabledindicator = disabledindicator;
  300. }
  301.  
  302. public Integer getEntrydate()
  303. {
  304. return entrydate;
  305. }
  306.  
  307. public String getEntrydateDisplay()
  308. {
  309. String vaRtn = "";
  310. if(this.entrydate != null)
  311. {
  312. vaRtn = DateConvert.storeDate2DisplayDate(String.valueOf(this.entrydate));
  313. }
  314. return vaRtn;
  315. }
  316.  
  317. public void setEntrydate(Integer entrydate)
  318. {
  319. this.entrydate = entrydate;
  320. }
  321.  
  322. public Integer getFinishdate()
  323. {
  324. return finishdate;
  325. }
  326.  
  327. public String getFinishdateDisplay()
  328. {
  329. String vaRtn = "";
  330. if(this.finishdate != null)
  331. {
  332. vaRtn = DateConvert.storeDate2DisplayDate(String.valueOf(this.finishdate));
  333. }
  334. return vaRtn;
  335. }
  336.  
  337. public void setFinishdate(Integer finishdate)
  338. {
  339. this.finishdate = finishdate;
  340. }
  341.  
  342. public String getFirstname()
  343. {
  344. return firstname;
  345. }
  346.  
  347. public void setFirstname(String firstname)
  348. {
  349. this.firstname = firstname;
  350. }
  351.  
  352. public String getGender()
  353. {
  354. return gender;
  355. }
  356.  
  357. public void setGender(String gender)
  358. {
  359. this.gender = gender;
  360. }
  361.  
  362. public String getHadj()
  363. {
  364. return hadj;
  365. }
  366.  
  367. public void setHadj(String hadj)
  368. {
  369. this.hadj = hadj;
  370. }
  371.  
  372. public String getIpaddress()
  373. {
  374. return ipaddress;
  375. }
  376.  
  377. public void setIpaddress(String ipaddress)
  378. {
  379. this.ipaddress = ipaddress;
  380. }
  381.  
  382. public String getLastname()
  383. {
  384. return lastname;
  385. }
  386.  
  387. public void setLastname(String lastname)
  388. {
  389. this.lastname = lastname;
  390. }
  391.  
  392. public Integer getLogincount()
  393. {
  394. return logincount;
  395. }
  396.  
  397. public void setLogincount(Integer logincount)
  398. {
  399. this.logincount = logincount;
  400. }
  401.  
  402. public String getMarriage()
  403. {
  404. return marriage;
  405. }
  406.  
  407. public void setMarriage(String marriage)
  408. {
  409. this.marriage = marriage;
  410. }
  411.  
  412. public String getOrdain()
  413. {
  414. return ordain;
  415. }
  416.  
  417. public void setOrdain(String ordain)
  418. {
  419. this.ordain = ordain;
  420. }
  421.  
  422. public Integer getOrganizeid()
  423. {
  424. return organizeid;
  425. }
  426.  
  427. public void setOrganizeid(Integer organizeid)
  428. {
  429. this.organizeid = organizeid;
  430. }
  431.  
  432. public String getPassword()
  433. {
  434. return password;
  435. }
  436.  
  437. public void setPassword(String password)
  438. {
  439. this.password = password;
  440. }
  441.  
  442. public String getPhoneno()
  443. {
  444. return phoneno;
  445. }
  446.  
  447. public void setPhoneno(String phoneno)
  448. {
  449. this.phoneno = phoneno;
  450. }
  451.  
  452. public String getPositionid()
  453. {
  454. return positionid;
  455. }
  456.  
  457. public void setPositionid(String positionid)
  458. {
  459. this.positionid = positionid;
  460. }
  461.  
  462. public byte getRecordstatus()
  463. {
  464. return recordstatus;
  465. }
  466.  
  467. public void setRecordstatus(byte recordstatus)
  468. {
  469. this.recordstatus = recordstatus;
  470. }
  471.  
  472. public String getReligion()
  473. {
  474. return religion;
  475. }
  476.  
  477. public void setReligion(String religion)
  478. {
  479. this.religion = religion;
  480. }
  481.  
  482. public Integer getRetiredate()
  483. {
  484. return retiredate;
  485. }
  486.  
  487. public String getRetiredateDisplay()
  488. {
  489. String vaRtn = "";
  490. if(this.retiredate != null)
  491. {
  492. vaRtn = DateConvert.storeDate2DisplayDate(String.valueOf(this.retiredate));
  493. }
  494. return vaRtn;
  495. }
  496.  
  497. public void setRetiredate(Integer retiredate)
  498. {
  499. this.retiredate = retiredate;
  500. }
  501.  
  502. public String getScreenid()
  503. {
  504. return screenid;
  505. }
  506.  
  507. public void setScreenid(String screenid)
  508. {
  509. this.screenid = screenid;
  510. }
  511.  
  512. public Integer getStartdate()
  513. {
  514. return startdate;
  515. }
  516.  
  517. public String getStartdateDisplay()
  518. {
  519. String vaRtn = "";
  520. if(this.startdate != null)
  521. {
  522. vaRtn = DateConvert.storeDate2DisplayDate(String.valueOf(this.startdate));
  523. }
  524. return vaRtn;
  525. }
  526.  
  527. public void setStartdate(Integer startdate)
  528. {
  529. this.startdate = startdate;
  530. }
  531.  
  532. public String getStatusid()
  533. {
  534. return statusid;
  535. }
  536.  
  537. public void setStatusid(String statusid)
  538. {
  539. this.statusid = statusid;
  540. }
  541.  
  542. public String getTitleid()
  543. {
  544. return titleid;
  545. }
  546.  
  547. public void setTitleid(String titleid)
  548. {
  549. this.titleid = titleid;
  550. }
  551.  
  552. public String getUsercode()
  553. {
  554. return usercode;
  555. }
  556.  
  557. public void setUsercode(String usercode)
  558. {
  559. this.usercode = usercode;
  560. }
  561.  
  562. public String getUserid()
  563. {
  564. return userid;
  565. }
  566.  
  567. public void setUserid(String userid)
  568. {
  569. this.userid = userid;
  570. }
  571.  
  572. public String getUseridcreated()
  573. {
  574. return useridcreated;
  575. }
  576.  
  577. public void setUseridcreated(String useridcreated)
  578. {
  579. this.useridcreated = useridcreated;
  580. }
  581.  
  582. public String getUseridupdated()
  583. {
  584. return useridupdated;
  585. }
  586.  
  587. public void setUseridupdated(String useridupdated)
  588. {
  589. this.useridupdated = useridupdated;
  590. }
  591.  
  592. public Integer getUserlevel()
  593. {
  594. return userlevel;
  595. }
  596.  
  597. public void setUserlevel(Integer userlevel)
  598. {
  599. this.userlevel = userlevel;
  600. }
  601.  
  602. public String getUsertype()
  603. {
  604. return usertype;
  605. }
  606.  
  607. public void setUsertype(String usertype)
  608. {
  609. this.usertype = usertype;
  610. }
  611.  
  612. public Integer getWorkorganizeid()
  613. {
  614. return workorganizeid;
  615. }
  616.  
  617. public void setWorkorganizeid(Integer workorganizeid)
  618. {
  619. this.workorganizeid = workorganizeid;
  620. }
  621.  
  622. public List<UserRole> getUserRoleList()
  623. {
  624. return userRoleList;
  625. }
  626.  
  627. public void setUserRoleList(List<UserRole> userRoleList)
  628. {
  629. this.userRoleList = userRoleList;
  630. }
  631.  
  632. public UserRole addUserRole(UserRole userRole)
  633. {
  634. getUserRoleList().add(userRole);
  635. userRole.setUserInfo(this);
  636. return userRole;
  637. }
  638.  
  639. public UserRole removeUserRole(UserRole userRole)
  640. {
  641. getUserRoleList().remove(userRole);
  642. userRole.setUserInfo(null);
  643. return userRole;
  644. }
  645.  
  646. public String getUseridupdatedDisplay()
  647. {
  648. String vaRtn = this.useridupdated;
  649. if(this.useridupdatedInfo != null)
  650. {
  651. vaRtn = vaRtn+"-"+this.useridupdatedInfo.getFirstname()+" "+this.useridupdatedInfo.getLastname();
  652. }
  653. return vaRtn;
  654. }
  655.  
  656. public String getNameDisplay()
  657. {
  658. String vaTitlename = "";
  659. if(this.title != null)
  660. {
  661. vaTitlename = this.title.getShortname();
  662. }
  663. String vaRtn = vaTitlename+" "+this.firstname+" "+this.lastname;
  664.  
  665. return vaRtn;
  666. }
  667.  
  668. public String getRecordstatusDescription()
  669. {
  670. String vaRecordstatusDescription = "";
  671.  
  672. if(this.recordstatus==0)
  673. {
  674. vaRecordstatusDescription = "Inactive";
  675. }
  676. else if(this.recordstatus==1)
  677. {
  678. vaRecordstatusDescription = "Active";
  679. }
  680.  
  681. return vaRecordstatusDescription;
  682. }
  683.  
  684. public Title getTitle()
  685. {
  686. return title;
  687. }
  688.  
  689. public void setTitle(Title title)
  690. {
  691. this.title = title;
  692. }
  693.  
  694. public OrganizeInfo getOrganizeInfo()
  695. {
  696. return organizeInfo;
  697. }
  698.  
  699. public void setOrganizeInfo(OrganizeInfo organizeInfo)
  700. {
  701. this.organizeInfo = organizeInfo;
  702. }
  703.  
  704. public OrganizeInfo getWorkorganizeInfo()
  705. {
  706. return workorganizeInfo;
  707. }
  708.  
  709. public void setWorkorganizeInfo(OrganizeInfo workorganizeInfo)
  710. {
  711. this.workorganizeInfo = workorganizeInfo;
  712. }
  713.  
  714. public StatusInfo getStatusInfo()
  715. {
  716. return statusInfo;
  717. }
  718.  
  719. public void setStatusInfo(StatusInfo statusInfo)
  720. {
  721. this.statusInfo = statusInfo;
  722. }
  723.  
  724.  
  725. public void setOfficialageyear(int officialageyear)
  726. {
  727. this.officialageyear = officialageyear;
  728. }
  729.  
  730. public int getOfficialageyear()
  731. {
  732. return officialageyear;
  733. }
  734.  
  735. public void setOfficialagemonth(int officialagemonth)
  736. {
  737. this.officialagemonth = officialagemonth;
  738. }
  739.  
  740. public int getOfficialagemonth()
  741. {
  742. return officialagemonth;
  743. }
  744.  
  745. public void setOfficialageday(int officialageday)
  746. {
  747. this.officialageday = officialageday;
  748. }
  749.  
  750. public int getOfficialageday()
  751. {
  752. return officialageday;
  753. }
  754.  
  755. public void setTotalannualleave(int totalannualleave)
  756. {
  757. this.totalannualleave = totalannualleave;
  758. }
  759.  
  760. public int getTotalannualleave()
  761. {
  762. return totalannualleave;
  763. }
  764.  
  765. public void setUseridupdatedInfo(UserInfo useridupdatedInfo)
  766. {
  767. this.useridupdatedInfo = useridupdatedInfo;
  768. }
  769.  
  770. public UserInfo getUseridupdatedInfo()
  771. {
  772. return useridupdatedInfo;
  773. }
  774. public String getOrganizePhoneNumber()
  775. {
  776. return (workorganizeInfo!=null&& workorganizeInfo.getPhoneno() != null )? workorganizeInfo.getPhoneno():"";
  777. }
  778. public String getOrganizeName()
  779. {
  780. return (workorganizeInfo!=null && workorganizeInfo.getOrganizename() != null)?workorganizeInfo.getOrganizename():"";
  781. }
  782.  
  783. @Override
  784. public String toString()
  785. {
  786. return "{\"nameDisplay\":\"" + (getNameDisplay())
  787. + "\", \"organizeid\":\"" + (organizeid==null?"":organizeid)
  788. + "\", \"positionid\":\"" + (positionid==null?"":positionid)
  789. + "\", \"statusid\":\"" + (statusid==null?"":statusid)
  790. + "\", \"userid\":\"" + (userid==null?"":userid)
  791. + "\", \"firstname\":\"" + (firstname==null?"":firstname)
  792. + "\", \"lastname\":\"" + (lastname==null?"":lastname)
  793. + "\", \"phoneno\":\"" + (phoneno==null?"":phoneno)
  794. + "\", \"organizePhoneNumber\":\"" + getOrganizePhoneNumber()
  795. + "\", \"organizeName\":\"" + getOrganizeName()
  796. + "\"}";
  797. }
  798. }
Advertisement
Add Comment
Please, Sign In to add comment