001// ______________________________________________________ 002// Generated by sql2java - https://github.com/10km/sql2java-2-6-7 (custom branch) 003// modified by guyadong from 004// sql2java original version https://sourceforge.net/projects/sql2java/ 005// JDBC driver used at code generation time: com.mysql.jdbc.Driver 006// template: bean.java.vm 007// ______________________________________________________ 008package net.gdface.facelog.db; 009import java.io.Serializable; 010import java.util.List; 011import java.util.Objects; 012 013import com.facebook.swift.codec.ThriftStruct; 014import com.facebook.swift.codec.ThriftField; 015import com.facebook.swift.codec.ThriftField.Requiredness; 016import io.swagger.annotations.ApiModel; 017import io.swagger.annotations.ApiModelProperty; 018/** 019 * PersonBean is a mapping of fl_person Table. 020 * <br>Meta Data Information (in progress): 021 * <ul> 022 * <li>comments: 人员基本描述信息 </li> 023 * </ul> 024 * @author guyadong 025*/ 026@ThriftStruct 027@ApiModel(description="人员基本描述信息") 028public final class PersonBean 029 implements Serializable,BaseBean<PersonBean>,Comparable<PersonBean>,Constant,Cloneable 030{ 031 private static final long serialVersionUID = 7741617836285025804L; 032 /** NULL {@link PersonBean} bean , IMMUTABLE instance */ 033 public static final PersonBean NULL = new PersonBean().asNULL().asImmutable(); 034 /** comments:用户id */ 035 @ApiModelProperty(value = "用户id" ,required=true ,dataType="Integer") 036 private Integer id; 037 038 /** comments:所属用户组id */ 039 @ApiModelProperty(value = "所属用户组id" ,dataType="Integer") 040 private Integer groupId; 041 042 /** comments:姓名 */ 043 @ApiModelProperty(value = "姓名" ,required=true ,dataType="String") 044 private String name; 045 046 /** comments:性别,0:女,1:男,其他:未定义 */ 047 @ApiModelProperty(value = "性别,0:女,1:男,其他:未定义" ,dataType="Integer") 048 private Integer sex; 049 050 /** comments:用户级别,NULL,0:普通用户,2:操作员,3:管理员,其他:未定义 */ 051 @ApiModelProperty(value = "用户级别,NULL,0:普通用户,2:操作员,3:管理员,其他:未定义" ,dataType="Integer") 052 private Integer rank; 053 054 /** comments:用户密码,MD5 */ 055 @ApiModelProperty(value = "用户密码,MD5" ,dataType="String") 056 private String password; 057 058 /** comments:出生日期 */ 059 @ApiModelProperty(value = "出生日期" ,dataType="Date") 060 private java.util.Date birthdate; 061 062 /** comments:手机号码 */ 063 @ApiModelProperty(value = "手机号码" ,dataType="String") 064 private String mobilePhone; 065 066 /** comments:证件类型,0:未知,1:身份证,2:护照,3:台胞证,4:港澳通行证,5:军官证,6:外国人居留证,7:员工卡,8:其他 */ 067 @ApiModelProperty(value = "证件类型,0:未知,1:身份证,2:护照,3:台胞证,4:港澳通行证,5:军官证,6:外国人居留证,7:员工卡,8:其他" ,dataType="Integer") 068 private Integer papersType; 069 070 /** comments:证件号码 */ 071 @ApiModelProperty(value = "证件号码" ,dataType="String") 072 private String papersNum; 073 074 /** comments:用户默认照片(证件照,标准照)的md5校验码,外键 */ 075 @ApiModelProperty(value = "用户默认照片(证件照,标准照)的md5校验码,外键" ,dataType="String") 076 private String imageMd5; 077 078 /** comments:验证有效期限(超过期限不能通过验证),为NULL永久有效 */ 079 @ApiModelProperty(value = "验证有效期限(超过期限不能通过验证),为NULL永久有效" ,dataType="Date") 080 private java.util.Date expiryDate; 081 082 /** comments:帐户激活日期,为NULL时,create_time字段即为激活日期 */ 083 @ApiModelProperty(value = "帐户激活日期,为NULL时,create_time字段即为激活日期" ,dataType="Date") 084 private java.util.Date activatedDate; 085 086 /** comments:备注 */ 087 @ApiModelProperty(value = "备注" ,dataType="String") 088 private String remark; 089 090 /** comments:应用项目自定义二进制扩展字段(最大64KB) */ 091 @ApiModelProperty(value = "应用项目自定义二进制扩展字段(最大64KB)" ,dataType="ByteBuffer") 092 private java.nio.ByteBuffer extBin; 093 094 /** comments:应用项目自定义文本扩展字段(最大64KB) */ 095 @ApiModelProperty(value = "应用项目自定义文本扩展字段(最大64KB)" ,dataType="String") 096 private String extTxt; 097 098 @ApiModelProperty(value = "create_time" ,dataType="Date") 099 private java.util.Date createTime; 100 101 @ApiModelProperty(value = "update_time" ,dataType="Date") 102 private java.util.Date updateTime; 103 104 /** flag whether {@code this} can be modified */ 105 private Boolean immutable; 106 /** columns modified flag */ 107 @ApiModelProperty(value="columns modified flag",dataType="int",required=true) 108 private int modified; 109 /** columns initialized flag */ 110 @ApiModelProperty(value="columns initialized flag",dataType="int",required=true) 111 private int initialized; 112 /** new record flag */ 113 @ApiModelProperty(value="new record flag",dataType="boolean",required=true) 114 private boolean isNew; 115 /** 116 * set immutable status 117 * @return {@code this} 118 */ 119 private PersonBean immutable(Boolean immutable) { 120 this.immutable = immutable; 121 return this; 122 } 123 /** 124 * set {@code this} as immutable object 125 * @return {@code this} 126 */ 127 public PersonBean asImmutable() { 128 return immutable(Boolean.TRUE); 129 } 130 /** 131 * @return {@code true} if {@code this} is a mutable object 132 */ 133 public boolean mutable(){ 134 return !Boolean.TRUE.equals(this.immutable); 135 } 136 /** 137 * @return {@code this} 138 * @throws IllegalStateException if {@code this} is a immutable object 139 */ 140 private PersonBean checkMutable(){ 141 if(!mutable()){ 142 throw new IllegalStateException("this is a immutable object"); 143 } 144 return this; 145 } 146 /** 147 * @return return a new mutable copy of this object. 148 */ 149 public PersonBean cloneMutable(){ 150 return clone().immutable(null); 151 } 152 @ThriftField(value=1,name="_new",requiredness=Requiredness.REQUIRED) 153 @Override 154 public boolean isNew() 155 { 156 return this.isNew; 157 } 158 159 160 @Override 161 public void isNew(boolean isNew) 162 { 163 this.isNew = isNew; 164 } 165 /** 166 * Specifies to the object if it has been set as new. 167 * 168 * @param isNew the boolean value to be assigned to the isNew field 169 */ 170 @ThriftField() 171 public void setNew(boolean isNew) 172 { 173 this.isNew = isNew; 174 } 175 /** 176 * @return the modified status of columns 177 */ 178 @ThriftField(value=2,requiredness=Requiredness.REQUIRED) 179 public int getModified(){ 180 return modified; 181 } 182 183 /** 184 * @param modified the modified status bit to be assigned to {@link #modified} 185 */ 186 @ThriftField() 187 public void setModified(int modified){ 188 this.modified = modified; 189 } 190 /** 191 * @return the initialized status of columns 192 */ 193 @ThriftField(value=3,requiredness=Requiredness.REQUIRED) 194 public int getInitialized(){ 195 return initialized; 196 } 197 198 /** 199 * @param initialized the initialized status bit to be assigned to {@link #initialized} 200 */ 201 @ThriftField() 202 public void setInitialized(int initialized){ 203 this.initialized = initialized; 204 } 205 protected static final <T extends Comparable<T>>boolean equals(T a, T b) { 206 return a == b || (a != null && 0==a.compareTo(b)); 207 } 208 public PersonBean(){ 209 super(); 210 reset(); 211 } 212 /** 213 * construct a new instance filled with primary keys 214 * @param id PK# 1 215 */ 216 public PersonBean(Integer id){ 217 this(); 218 setId(id); 219 } 220 /** 221 * Getter method for {@link #id}.<br> 222 * PRIMARY KEY.<br> 223 * Meta Data Information (in progress): 224 * <ul> 225 * <li>full name: fl_person.id</li> 226 * <li> imported key: fl_log.person_id</li> 227 * <li> imported key: fl_feature.person_id</li> 228 * <li>comments: 用户id</li> 229 * <li>AUTO_INCREMENT</li> 230 * <li>NOT NULL</li> 231 * <li>column size: 10</li> 232 * <li>JDBC type returned by the driver: Types.INTEGER</li> 233 * </ul> 234 * 235 * @return the value of id 236 */ 237 @ThriftField(value=4) 238 public Integer getId(){ 239 return id; 240 } 241 /** 242 * Setter method for {@link #id}.<br> 243 * The new value is set only if equals() says it is different, 244 * or if one of either the new value or the current value is null. 245 * In case the new value is different, it is set and the field is marked as 'modified'. 246 * 247 * @param newVal the new value to be assigned to id 248 */ 249 public void setId(Integer newVal) 250 { 251 checkMutable(); 252 253 modified |= FL_PERSON_ID_ID_MASK; 254 initialized |= FL_PERSON_ID_ID_MASK; 255 256 if (Objects.equals(newVal, id)) { 257 return; 258 } 259 id = newVal; 260 } 261 /** 262 * setter for thrift:swift support<br> 263 * without modification for {@link #modified} and {@link #initialized}<br> 264 * <b>NOTE:</b>DO NOT use the method in your code 265 */ 266 @ThriftField(name = "id") 267 public void writeId(Integer newVal){ 268 checkMutable(); 269 id = newVal; 270 } 271 /** 272 * Setter method for {@link #id}.<br> 273 * Convenient for those who do not want to deal with Objects for primary types. 274 * 275 * @param newVal the new value to be assigned to id 276 */ 277 public void setId(int newVal) 278 { 279 setId(new Integer(newVal)); 280 } 281 /** 282 * Determines if the id has been modified. 283 * 284 * @return true if the field has been modified, false if the field has not been modified 285 */ 286 public boolean checkIdModified() 287 { 288 return 0L != (modified & FL_PERSON_ID_ID_MASK); 289 } 290 291 /** 292 * Determines if the id has been initialized.<br> 293 * 294 * It is useful to determine if a field is null on purpose or just because it has not been initialized. 295 * 296 * @return true if the field has been initialized, false otherwise 297 */ 298 public boolean checkIdInitialized() 299 { 300 return 0L != (initialized & FL_PERSON_ID_ID_MASK); 301 } 302 /** 303 * Getter method for {@link #groupId}.<br> 304 * Meta Data Information (in progress): 305 * <ul> 306 * <li>full name: fl_person.group_id</li> 307 * <li> foreign key: fl_person_group.id</li> 308 * <li>comments: 所属用户组id</li> 309 * <li>default value: '1'</li> 310 * <li>column size: 10</li> 311 * <li>JDBC type returned by the driver: Types.INTEGER</li> 312 * </ul> 313 * 314 * @return the value of groupId 315 */ 316 @ThriftField(value=5) 317 public Integer getGroupId(){ 318 return groupId; 319 } 320 /** 321 * Setter method for {@link #groupId}.<br> 322 * The new value is set only if equals() says it is different, 323 * or if one of either the new value or the current value is null. 324 * In case the new value is different, it is set and the field is marked as 'modified'. 325 * 326 * @param newVal the new value to be assigned to groupId 327 */ 328 public void setGroupId(Integer newVal) 329 { 330 checkMutable(); 331 332 modified |= FL_PERSON_ID_GROUP_ID_MASK; 333 initialized |= FL_PERSON_ID_GROUP_ID_MASK; 334 335 if (Objects.equals(newVal, groupId)) { 336 return; 337 } 338 groupId = newVal; 339 } 340 /** 341 * setter for thrift:swift support<br> 342 * without modification for {@link #modified} and {@link #initialized}<br> 343 * <b>NOTE:</b>DO NOT use the method in your code 344 */ 345 @ThriftField(name = "groupId") 346 public void writeGroupId(Integer newVal){ 347 checkMutable(); 348 groupId = newVal; 349 } 350 /** 351 * Setter method for {@link #groupId}.<br> 352 * Convenient for those who do not want to deal with Objects for primary types. 353 * 354 * @param newVal the new value to be assigned to groupId 355 */ 356 public void setGroupId(int newVal) 357 { 358 setGroupId(new Integer(newVal)); 359 } 360 /** 361 * Determines if the groupId has been modified. 362 * 363 * @return true if the field has been modified, false if the field has not been modified 364 */ 365 public boolean checkGroupIdModified() 366 { 367 return 0L != (modified & FL_PERSON_ID_GROUP_ID_MASK); 368 } 369 370 /** 371 * Determines if the groupId has been initialized.<br> 372 * 373 * It is useful to determine if a field is null on purpose or just because it has not been initialized. 374 * 375 * @return true if the field has been initialized, false otherwise 376 */ 377 public boolean checkGroupIdInitialized() 378 { 379 return 0L != (initialized & FL_PERSON_ID_GROUP_ID_MASK); 380 } 381 /** 382 * Getter method for {@link #name}.<br> 383 * Meta Data Information (in progress): 384 * <ul> 385 * <li>full name: fl_person.name</li> 386 * <li>comments: 姓名</li> 387 * <li>NOT NULL</li> 388 * <li>column size: 32</li> 389 * <li>JDBC type returned by the driver: Types.VARCHAR</li> 390 * </ul> 391 * 392 * @return the value of name 393 */ 394 @ThriftField(value=6) 395 public String getName(){ 396 return name; 397 } 398 /** 399 * Setter method for {@link #name}.<br> 400 * The new value is set only if equals() says it is different, 401 * or if one of either the new value or the current value is null. 402 * In case the new value is different, it is set and the field is marked as 'modified'. 403 * 404 * @param newVal the new value( NOT NULL) to be assigned to name 405 */ 406 public void setName(String newVal) 407 { 408 checkMutable(); 409 410 modified |= FL_PERSON_ID_NAME_MASK; 411 initialized |= FL_PERSON_ID_NAME_MASK; 412 413 if (Objects.equals(newVal, name)) { 414 return; 415 } 416 name = newVal; 417 } 418 /** 419 * setter for thrift:swift support<br> 420 * without modification for {@link #modified} and {@link #initialized}<br> 421 * <b>NOTE:</b>DO NOT use the method in your code 422 */ 423 @ThriftField(name = "name") 424 public void writeName(String newVal){ 425 checkMutable(); 426 name = newVal; 427 } 428 /** 429 * Determines if the name has been modified. 430 * 431 * @return true if the field has been modified, false if the field has not been modified 432 */ 433 public boolean checkNameModified() 434 { 435 return 0L != (modified & FL_PERSON_ID_NAME_MASK); 436 } 437 438 /** 439 * Determines if the name has been initialized.<br> 440 * 441 * It is useful to determine if a field is null on purpose or just because it has not been initialized. 442 * 443 * @return true if the field has been initialized, false otherwise 444 */ 445 public boolean checkNameInitialized() 446 { 447 return 0L != (initialized & FL_PERSON_ID_NAME_MASK); 448 } 449 /** 450 * Getter method for {@link #sex}.<br> 451 * Meta Data Information (in progress): 452 * <ul> 453 * <li>full name: fl_person.sex</li> 454 * <li>comments: 性别,0:女,1:男,其他:未定义</li> 455 * <li>column size: 3</li> 456 * <li>JDBC type returned by the driver: Types.TINYINT</li> 457 * </ul> 458 * 459 * @return the value of sex 460 */ 461 @ThriftField(value=7) 462 public Integer getSex(){ 463 return sex; 464 } 465 /** 466 * Setter method for {@link #sex}.<br> 467 * The new value is set only if equals() says it is different, 468 * or if one of either the new value or the current value is null. 469 * In case the new value is different, it is set and the field is marked as 'modified'. 470 * 471 * @param newVal the new value to be assigned to sex 472 */ 473 public void setSex(Integer newVal) 474 { 475 checkMutable(); 476 477 modified |= FL_PERSON_ID_SEX_MASK; 478 initialized |= FL_PERSON_ID_SEX_MASK; 479 480 if (Objects.equals(newVal, sex)) { 481 return; 482 } 483 sex = newVal; 484 } 485 /** 486 * setter for thrift:swift support<br> 487 * without modification for {@link #modified} and {@link #initialized}<br> 488 * <b>NOTE:</b>DO NOT use the method in your code 489 */ 490 @ThriftField(name = "sex") 491 public void writeSex(Integer newVal){ 492 checkMutable(); 493 sex = newVal; 494 } 495 /** 496 * Setter method for {@link #sex}.<br> 497 * Convenient for those who do not want to deal with Objects for primary types. 498 * 499 * @param newVal the new value to be assigned to sex 500 */ 501 public void setSex(int newVal) 502 { 503 setSex(new Integer(newVal)); 504 } 505 /** 506 * Determines if the sex has been modified. 507 * 508 * @return true if the field has been modified, false if the field has not been modified 509 */ 510 public boolean checkSexModified() 511 { 512 return 0L != (modified & FL_PERSON_ID_SEX_MASK); 513 } 514 515 /** 516 * Determines if the sex has been initialized.<br> 517 * 518 * It is useful to determine if a field is null on purpose or just because it has not been initialized. 519 * 520 * @return true if the field has been initialized, false otherwise 521 */ 522 public boolean checkSexInitialized() 523 { 524 return 0L != (initialized & FL_PERSON_ID_SEX_MASK); 525 } 526 /** 527 * Getter method for {@link #rank}.<br> 528 * Meta Data Information (in progress): 529 * <ul> 530 * <li>full name: fl_person.rank</li> 531 * <li>comments: 用户级别,NULL,0:普通用户,2:操作员,3:管理员,其他:未定义</li> 532 * <li>column size: 3</li> 533 * <li>JDBC type returned by the driver: Types.TINYINT</li> 534 * </ul> 535 * 536 * @return the value of rank 537 */ 538 @ThriftField(value=8) 539 public Integer getRank(){ 540 return rank; 541 } 542 /** 543 * Setter method for {@link #rank}.<br> 544 * The new value is set only if equals() says it is different, 545 * or if one of either the new value or the current value is null. 546 * In case the new value is different, it is set and the field is marked as 'modified'. 547 * 548 * @param newVal the new value to be assigned to rank 549 */ 550 public void setRank(Integer newVal) 551 { 552 checkMutable(); 553 554 modified |= FL_PERSON_ID_RANK_MASK; 555 initialized |= FL_PERSON_ID_RANK_MASK; 556 557 if (Objects.equals(newVal, rank)) { 558 return; 559 } 560 rank = newVal; 561 } 562 /** 563 * setter for thrift:swift support<br> 564 * without modification for {@link #modified} and {@link #initialized}<br> 565 * <b>NOTE:</b>DO NOT use the method in your code 566 */ 567 @ThriftField(name = "rank") 568 public void writeRank(Integer newVal){ 569 checkMutable(); 570 rank = newVal; 571 } 572 /** 573 * Setter method for {@link #rank}.<br> 574 * Convenient for those who do not want to deal with Objects for primary types. 575 * 576 * @param newVal the new value to be assigned to rank 577 */ 578 public void setRank(int newVal) 579 { 580 setRank(new Integer(newVal)); 581 } 582 /** 583 * Determines if the rank has been modified. 584 * 585 * @return true if the field has been modified, false if the field has not been modified 586 */ 587 public boolean checkRankModified() 588 { 589 return 0L != (modified & FL_PERSON_ID_RANK_MASK); 590 } 591 592 /** 593 * Determines if the rank has been initialized.<br> 594 * 595 * It is useful to determine if a field is null on purpose or just because it has not been initialized. 596 * 597 * @return true if the field has been initialized, false otherwise 598 */ 599 public boolean checkRankInitialized() 600 { 601 return 0L != (initialized & FL_PERSON_ID_RANK_MASK); 602 } 603 /** 604 * Getter method for {@link #password}.<br> 605 * Meta Data Information (in progress): 606 * <ul> 607 * <li>full name: fl_person.password</li> 608 * <li>comments: 用户密码,MD5</li> 609 * <li>column size: 32</li> 610 * <li>JDBC type returned by the driver: Types.CHAR</li> 611 * </ul> 612 * 613 * @return the value of password 614 */ 615 @ThriftField(value=9) 616 public String getPassword(){ 617 return password; 618 } 619 /** 620 * Setter method for {@link #password}.<br> 621 * The new value is set only if equals() says it is different, 622 * or if one of either the new value or the current value is null. 623 * In case the new value is different, it is set and the field is marked as 'modified'. 624 * 625 * @param newVal the new value to be assigned to password 626 */ 627 public void setPassword(String newVal) 628 { 629 checkMutable(); 630 631 modified |= FL_PERSON_ID_PASSWORD_MASK; 632 initialized |= FL_PERSON_ID_PASSWORD_MASK; 633 634 if (Objects.equals(newVal, password)) { 635 return; 636 } 637 password = newVal; 638 } 639 /** 640 * setter for thrift:swift support<br> 641 * without modification for {@link #modified} and {@link #initialized}<br> 642 * <b>NOTE:</b>DO NOT use the method in your code 643 */ 644 @ThriftField(name = "password") 645 public void writePassword(String newVal){ 646 checkMutable(); 647 password = newVal; 648 } 649 /** 650 * Determines if the password has been modified. 651 * 652 * @return true if the field has been modified, false if the field has not been modified 653 */ 654 public boolean checkPasswordModified() 655 { 656 return 0L != (modified & FL_PERSON_ID_PASSWORD_MASK); 657 } 658 659 /** 660 * Determines if the password has been initialized.<br> 661 * 662 * It is useful to determine if a field is null on purpose or just because it has not been initialized. 663 * 664 * @return true if the field has been initialized, false otherwise 665 */ 666 public boolean checkPasswordInitialized() 667 { 668 return 0L != (initialized & FL_PERSON_ID_PASSWORD_MASK); 669 } 670 /** 671 * Getter method for {@link #birthdate}.<br> 672 * Meta Data Information (in progress): 673 * <ul> 674 * <li>full name: fl_person.birthdate</li> 675 * <li>comments: 出生日期</li> 676 * <li>column size: 10</li> 677 * <li>JDBC type returned by the driver: Types.DATE</li> 678 * </ul> 679 * 680 * @return the value of birthdate 681 */ 682 public java.util.Date getBirthdate(){ 683 return birthdate; 684 } 685 /** 686 * use Long to represent date type for thrift:swift support 687 * @see #getBirthdate() 688 */ 689 @ThriftField(name = "birthdate",value = 10) 690 public Long readBirthdate(){ 691 return null == birthdate ? null:birthdate.getTime(); 692 } 693 /** 694 * Setter method for {@link #birthdate}.<br> 695 * The new value is set only if equals() says it is different, 696 * or if one of either the new value or the current value is null. 697 * In case the new value is different, it is set and the field is marked as 'modified'. 698 * 699 * @param newVal the new value to be assigned to birthdate 700 */ 701 public void setBirthdate(java.util.Date newVal) 702 { 703 checkMutable(); 704 705 modified |= FL_PERSON_ID_BIRTHDATE_MASK; 706 initialized |= FL_PERSON_ID_BIRTHDATE_MASK; 707 708 if (Objects.equals(newVal, birthdate)) { 709 return; 710 } 711 birthdate = newVal; 712 } 713 /** 714 * setter for thrift:swift support<br> 715 * without modification for {@link #modified} and {@link #initialized}<br> 716 * <b>NOTE:</b>DO NOT use the method in your code 717 */ 718 @ThriftField(name = "birthdate") 719 public void writeBirthdate(Long newVal){ 720 checkMutable(); 721 birthdate = null == newVal?null:new java.util.Date(newVal); 722 } 723 /** 724 * Setter method for {@link #birthdate}.<br> 725 * Convenient for those who do not want to deal with Objects for primary types. 726 * 727 * @param newVal the new value to be assigned to birthdate 728 */ 729 public void setBirthdate(long newVal) 730 { 731 setBirthdate(new java.util.Date(newVal)); 732 } 733 /** 734 * Setter method for {@link #birthdate}.<br> 735 * @param newVal the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this Date object. 736 */ 737 public void setBirthdate(Long newVal) 738 { 739 setBirthdate(null == newVal ? null : new java.util.Date(newVal)); 740 } 741 /** 742 * Determines if the birthdate has been modified. 743 * 744 * @return true if the field has been modified, false if the field has not been modified 745 */ 746 public boolean checkBirthdateModified() 747 { 748 return 0L != (modified & FL_PERSON_ID_BIRTHDATE_MASK); 749 } 750 751 /** 752 * Determines if the birthdate has been initialized.<br> 753 * 754 * It is useful to determine if a field is null on purpose or just because it has not been initialized. 755 * 756 * @return true if the field has been initialized, false otherwise 757 */ 758 public boolean checkBirthdateInitialized() 759 { 760 return 0L != (initialized & FL_PERSON_ID_BIRTHDATE_MASK); 761 } 762 /** 763 * Getter method for {@link #mobilePhone}.<br> 764 * Meta Data Information (in progress): 765 * <ul> 766 * <li>full name: fl_person.mobile_phone</li> 767 * <li>comments: 手机号码</li> 768 * <li>column size: 11</li> 769 * <li>JDBC type returned by the driver: Types.CHAR</li> 770 * </ul> 771 * 772 * @return the value of mobilePhone 773 */ 774 @ThriftField(value=11) 775 public String getMobilePhone(){ 776 return mobilePhone; 777 } 778 /** 779 * Setter method for {@link #mobilePhone}.<br> 780 * The new value is set only if equals() says it is different, 781 * or if one of either the new value or the current value is null. 782 * In case the new value is different, it is set and the field is marked as 'modified'. 783 * 784 * @param newVal the new value to be assigned to mobilePhone 785 */ 786 public void setMobilePhone(String newVal) 787 { 788 checkMutable(); 789 790 modified |= FL_PERSON_ID_MOBILE_PHONE_MASK; 791 initialized |= FL_PERSON_ID_MOBILE_PHONE_MASK; 792 793 if (Objects.equals(newVal, mobilePhone)) { 794 return; 795 } 796 mobilePhone = newVal; 797 } 798 /** 799 * setter for thrift:swift support<br> 800 * without modification for {@link #modified} and {@link #initialized}<br> 801 * <b>NOTE:</b>DO NOT use the method in your code 802 */ 803 @ThriftField(name = "mobilePhone") 804 public void writeMobilePhone(String newVal){ 805 checkMutable(); 806 mobilePhone = newVal; 807 } 808 /** 809 * Determines if the mobilePhone has been modified. 810 * 811 * @return true if the field has been modified, false if the field has not been modified 812 */ 813 public boolean checkMobilePhoneModified() 814 { 815 return 0L != (modified & FL_PERSON_ID_MOBILE_PHONE_MASK); 816 } 817 818 /** 819 * Determines if the mobilePhone has been initialized.<br> 820 * 821 * It is useful to determine if a field is null on purpose or just because it has not been initialized. 822 * 823 * @return true if the field has been initialized, false otherwise 824 */ 825 public boolean checkMobilePhoneInitialized() 826 { 827 return 0L != (initialized & FL_PERSON_ID_MOBILE_PHONE_MASK); 828 } 829 /** 830 * Getter method for {@link #papersType}.<br> 831 * Meta Data Information (in progress): 832 * <ul> 833 * <li>full name: fl_person.papers_type</li> 834 * <li>comments: 证件类型,0:未知,1:身份证,2:护照,3:台胞证,4:港澳通行证,5:军官证,6:外国人居留证,7:员工卡,8:其他</li> 835 * <li>column size: 3</li> 836 * <li>JDBC type returned by the driver: Types.TINYINT</li> 837 * </ul> 838 * 839 * @return the value of papersType 840 */ 841 @ThriftField(value=12) 842 public Integer getPapersType(){ 843 return papersType; 844 } 845 /** 846 * Setter method for {@link #papersType}.<br> 847 * The new value is set only if equals() says it is different, 848 * or if one of either the new value or the current value is null. 849 * In case the new value is different, it is set and the field is marked as 'modified'. 850 * 851 * @param newVal the new value to be assigned to papersType 852 */ 853 public void setPapersType(Integer newVal) 854 { 855 checkMutable(); 856 857 modified |= FL_PERSON_ID_PAPERS_TYPE_MASK; 858 initialized |= FL_PERSON_ID_PAPERS_TYPE_MASK; 859 860 if (Objects.equals(newVal, papersType)) { 861 return; 862 } 863 papersType = newVal; 864 } 865 /** 866 * setter for thrift:swift support<br> 867 * without modification for {@link #modified} and {@link #initialized}<br> 868 * <b>NOTE:</b>DO NOT use the method in your code 869 */ 870 @ThriftField(name = "papersType") 871 public void writePapersType(Integer newVal){ 872 checkMutable(); 873 papersType = newVal; 874 } 875 /** 876 * Setter method for {@link #papersType}.<br> 877 * Convenient for those who do not want to deal with Objects for primary types. 878 * 879 * @param newVal the new value to be assigned to papersType 880 */ 881 public void setPapersType(int newVal) 882 { 883 setPapersType(new Integer(newVal)); 884 } 885 /** 886 * Determines if the papersType has been modified. 887 * 888 * @return true if the field has been modified, false if the field has not been modified 889 */ 890 public boolean checkPapersTypeModified() 891 { 892 return 0L != (modified & FL_PERSON_ID_PAPERS_TYPE_MASK); 893 } 894 895 /** 896 * Determines if the papersType has been initialized.<br> 897 * 898 * It is useful to determine if a field is null on purpose or just because it has not been initialized. 899 * 900 * @return true if the field has been initialized, false otherwise 901 */ 902 public boolean checkPapersTypeInitialized() 903 { 904 return 0L != (initialized & FL_PERSON_ID_PAPERS_TYPE_MASK); 905 } 906 /** 907 * Getter method for {@link #papersNum}.<br> 908 * Meta Data Information (in progress): 909 * <ul> 910 * <li>full name: fl_person.papers_num</li> 911 * <li>comments: 证件号码</li> 912 * <li>column size: 32</li> 913 * <li>JDBC type returned by the driver: Types.VARCHAR</li> 914 * </ul> 915 * 916 * @return the value of papersNum 917 */ 918 @ThriftField(value=13) 919 public String getPapersNum(){ 920 return papersNum; 921 } 922 /** 923 * Setter method for {@link #papersNum}.<br> 924 * The new value is set only if equals() says it is different, 925 * or if one of either the new value or the current value is null. 926 * In case the new value is different, it is set and the field is marked as 'modified'. 927 * 928 * @param newVal the new value to be assigned to papersNum 929 */ 930 public void setPapersNum(String newVal) 931 { 932 checkMutable(); 933 934 modified |= FL_PERSON_ID_PAPERS_NUM_MASK; 935 initialized |= FL_PERSON_ID_PAPERS_NUM_MASK; 936 937 if (Objects.equals(newVal, papersNum)) { 938 return; 939 } 940 papersNum = newVal; 941 } 942 /** 943 * setter for thrift:swift support<br> 944 * without modification for {@link #modified} and {@link #initialized}<br> 945 * <b>NOTE:</b>DO NOT use the method in your code 946 */ 947 @ThriftField(name = "papersNum") 948 public void writePapersNum(String newVal){ 949 checkMutable(); 950 papersNum = newVal; 951 } 952 /** 953 * Determines if the papersNum has been modified. 954 * 955 * @return true if the field has been modified, false if the field has not been modified 956 */ 957 public boolean checkPapersNumModified() 958 { 959 return 0L != (modified & FL_PERSON_ID_PAPERS_NUM_MASK); 960 } 961 962 /** 963 * Determines if the papersNum has been initialized.<br> 964 * 965 * It is useful to determine if a field is null on purpose or just because it has not been initialized. 966 * 967 * @return true if the field has been initialized, false otherwise 968 */ 969 public boolean checkPapersNumInitialized() 970 { 971 return 0L != (initialized & FL_PERSON_ID_PAPERS_NUM_MASK); 972 } 973 /** 974 * Getter method for {@link #imageMd5}.<br> 975 * Meta Data Information (in progress): 976 * <ul> 977 * <li>full name: fl_person.image_md5</li> 978 * <li> foreign key: fl_image.md5</li> 979 * <li>comments: 用户默认照片(证件照,标准照)的md5校验码,外键</li> 980 * <li>column size: 32</li> 981 * <li>JDBC type returned by the driver: Types.CHAR</li> 982 * </ul> 983 * 984 * @return the value of imageMd5 985 */ 986 @ThriftField(value=14) 987 public String getImageMd5(){ 988 return imageMd5; 989 } 990 /** 991 * Setter method for {@link #imageMd5}.<br> 992 * The new value is set only if equals() says it is different, 993 * or if one of either the new value or the current value is null. 994 * In case the new value is different, it is set and the field is marked as 'modified'. 995 * 996 * @param newVal the new value to be assigned to imageMd5 997 */ 998 public void setImageMd5(String newVal) 999 { 1000 checkMutable(); 1001 1002 modified |= FL_PERSON_ID_IMAGE_MD5_MASK; 1003 initialized |= FL_PERSON_ID_IMAGE_MD5_MASK; 1004 1005 if (Objects.equals(newVal, imageMd5)) { 1006 return; 1007 } 1008 imageMd5 = newVal; 1009 } 1010 /** 1011 * setter for thrift:swift support<br> 1012 * without modification for {@link #modified} and {@link #initialized}<br> 1013 * <b>NOTE:</b>DO NOT use the method in your code 1014 */ 1015 @ThriftField(name = "imageMd5") 1016 public void writeImageMd5(String newVal){ 1017 checkMutable(); 1018 imageMd5 = newVal; 1019 } 1020 /** 1021 * Determines if the imageMd5 has been modified. 1022 * 1023 * @return true if the field has been modified, false if the field has not been modified 1024 */ 1025 public boolean checkImageMd5Modified() 1026 { 1027 return 0L != (modified & FL_PERSON_ID_IMAGE_MD5_MASK); 1028 } 1029 1030 /** 1031 * Determines if the imageMd5 has been initialized.<br> 1032 * 1033 * It is useful to determine if a field is null on purpose or just because it has not been initialized. 1034 * 1035 * @return true if the field has been initialized, false otherwise 1036 */ 1037 public boolean checkImageMd5Initialized() 1038 { 1039 return 0L != (initialized & FL_PERSON_ID_IMAGE_MD5_MASK); 1040 } 1041 /** 1042 * Getter method for {@link #expiryDate}.<br> 1043 * Meta Data Information (in progress): 1044 * <ul> 1045 * <li>full name: fl_person.expiry_date</li> 1046 * <li>comments: 验证有效期限(超过期限不能通过验证),为NULL永久有效</li> 1047 * <li>default value: '2050-12-31'</li> 1048 * <li>column size: 10</li> 1049 * <li>JDBC type returned by the driver: Types.DATE</li> 1050 * </ul> 1051 * 1052 * @return the value of expiryDate 1053 */ 1054 public java.util.Date getExpiryDate(){ 1055 return expiryDate; 1056 } 1057 /** 1058 * use Long to represent date type for thrift:swift support 1059 * @see #getExpiryDate() 1060 */ 1061 @ThriftField(name = "expiryDate",value = 15) 1062 public Long readExpiryDate(){ 1063 return null == expiryDate ? null:expiryDate.getTime(); 1064 } 1065 /** 1066 * Setter method for {@link #expiryDate}.<br> 1067 * The new value is set only if equals() says it is different, 1068 * or if one of either the new value or the current value is null. 1069 * In case the new value is different, it is set and the field is marked as 'modified'. 1070 * 1071 * @param newVal the new value to be assigned to expiryDate 1072 */ 1073 public void setExpiryDate(java.util.Date newVal) 1074 { 1075 checkMutable(); 1076 1077 modified |= FL_PERSON_ID_EXPIRY_DATE_MASK; 1078 initialized |= FL_PERSON_ID_EXPIRY_DATE_MASK; 1079 1080 if (Objects.equals(newVal, expiryDate)) { 1081 return; 1082 } 1083 expiryDate = newVal; 1084 } 1085 /** 1086 * setter for thrift:swift support<br> 1087 * without modification for {@link #modified} and {@link #initialized}<br> 1088 * <b>NOTE:</b>DO NOT use the method in your code 1089 */ 1090 @ThriftField(name = "expiryDate") 1091 public void writeExpiryDate(Long newVal){ 1092 checkMutable(); 1093 expiryDate = null == newVal?null:new java.util.Date(newVal); 1094 } 1095 /** 1096 * Setter method for {@link #expiryDate}.<br> 1097 * Convenient for those who do not want to deal with Objects for primary types. 1098 * 1099 * @param newVal the new value to be assigned to expiryDate 1100 */ 1101 public void setExpiryDate(long newVal) 1102 { 1103 setExpiryDate(new java.util.Date(newVal)); 1104 } 1105 /** 1106 * Setter method for {@link #expiryDate}.<br> 1107 * @param newVal the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this Date object. 1108 */ 1109 public void setExpiryDate(Long newVal) 1110 { 1111 setExpiryDate(null == newVal ? null : new java.util.Date(newVal)); 1112 } 1113 /** 1114 * Determines if the expiryDate has been modified. 1115 * 1116 * @return true if the field has been modified, false if the field has not been modified 1117 */ 1118 public boolean checkExpiryDateModified() 1119 { 1120 return 0L != (modified & FL_PERSON_ID_EXPIRY_DATE_MASK); 1121 } 1122 1123 /** 1124 * Determines if the expiryDate has been initialized.<br> 1125 * 1126 * It is useful to determine if a field is null on purpose or just because it has not been initialized. 1127 * 1128 * @return true if the field has been initialized, false otherwise 1129 */ 1130 public boolean checkExpiryDateInitialized() 1131 { 1132 return 0L != (initialized & FL_PERSON_ID_EXPIRY_DATE_MASK); 1133 } 1134 /** 1135 * Getter method for {@link #activatedDate}.<br> 1136 * Meta Data Information (in progress): 1137 * <ul> 1138 * <li>full name: fl_person.activated_date</li> 1139 * <li>comments: 帐户激活日期,为NULL时,create_time字段即为激活日期</li> 1140 * <li>column size: 10</li> 1141 * <li>JDBC type returned by the driver: Types.DATE</li> 1142 * </ul> 1143 * 1144 * @return the value of activatedDate 1145 */ 1146 public java.util.Date getActivatedDate(){ 1147 return activatedDate; 1148 } 1149 /** 1150 * use Long to represent date type for thrift:swift support 1151 * @see #getActivatedDate() 1152 */ 1153 @ThriftField(name = "activatedDate",value = 16) 1154 public Long readActivatedDate(){ 1155 return null == activatedDate ? null:activatedDate.getTime(); 1156 } 1157 /** 1158 * Setter method for {@link #activatedDate}.<br> 1159 * The new value is set only if equals() says it is different, 1160 * or if one of either the new value or the current value is null. 1161 * In case the new value is different, it is set and the field is marked as 'modified'. 1162 * 1163 * @param newVal the new value to be assigned to activatedDate 1164 */ 1165 public void setActivatedDate(java.util.Date newVal) 1166 { 1167 checkMutable(); 1168 1169 modified |= FL_PERSON_ID_ACTIVATED_DATE_MASK; 1170 initialized |= FL_PERSON_ID_ACTIVATED_DATE_MASK; 1171 1172 if (Objects.equals(newVal, activatedDate)) { 1173 return; 1174 } 1175 activatedDate = newVal; 1176 } 1177 /** 1178 * setter for thrift:swift support<br> 1179 * without modification for {@link #modified} and {@link #initialized}<br> 1180 * <b>NOTE:</b>DO NOT use the method in your code 1181 */ 1182 @ThriftField(name = "activatedDate") 1183 public void writeActivatedDate(Long newVal){ 1184 checkMutable(); 1185 activatedDate = null == newVal?null:new java.util.Date(newVal); 1186 } 1187 /** 1188 * Setter method for {@link #activatedDate}.<br> 1189 * Convenient for those who do not want to deal with Objects for primary types. 1190 * 1191 * @param newVal the new value to be assigned to activatedDate 1192 */ 1193 public void setActivatedDate(long newVal) 1194 { 1195 setActivatedDate(new java.util.Date(newVal)); 1196 } 1197 /** 1198 * Setter method for {@link #activatedDate}.<br> 1199 * @param newVal the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this Date object. 1200 */ 1201 public void setActivatedDate(Long newVal) 1202 { 1203 setActivatedDate(null == newVal ? null : new java.util.Date(newVal)); 1204 } 1205 /** 1206 * Determines if the activatedDate has been modified. 1207 * 1208 * @return true if the field has been modified, false if the field has not been modified 1209 */ 1210 public boolean checkActivatedDateModified() 1211 { 1212 return 0L != (modified & FL_PERSON_ID_ACTIVATED_DATE_MASK); 1213 } 1214 1215 /** 1216 * Determines if the activatedDate has been initialized.<br> 1217 * 1218 * It is useful to determine if a field is null on purpose or just because it has not been initialized. 1219 * 1220 * @return true if the field has been initialized, false otherwise 1221 */ 1222 public boolean checkActivatedDateInitialized() 1223 { 1224 return 0L != (initialized & FL_PERSON_ID_ACTIVATED_DATE_MASK); 1225 } 1226 /** 1227 * Getter method for {@link #remark}.<br> 1228 * Meta Data Information (in progress): 1229 * <ul> 1230 * <li>full name: fl_person.remark</li> 1231 * <li>comments: 备注</li> 1232 * <li>column size: 256</li> 1233 * <li>JDBC type returned by the driver: Types.VARCHAR</li> 1234 * </ul> 1235 * 1236 * @return the value of remark 1237 */ 1238 @ThriftField(value=17) 1239 public String getRemark(){ 1240 return remark; 1241 } 1242 /** 1243 * Setter method for {@link #remark}.<br> 1244 * The new value is set only if equals() says it is different, 1245 * or if one of either the new value or the current value is null. 1246 * In case the new value is different, it is set and the field is marked as 'modified'. 1247 * 1248 * @param newVal the new value to be assigned to remark 1249 */ 1250 public void setRemark(String newVal) 1251 { 1252 checkMutable(); 1253 1254 modified |= FL_PERSON_ID_REMARK_MASK; 1255 initialized |= FL_PERSON_ID_REMARK_MASK; 1256 1257 if (Objects.equals(newVal, remark)) { 1258 return; 1259 } 1260 remark = newVal; 1261 } 1262 /** 1263 * setter for thrift:swift support<br> 1264 * without modification for {@link #modified} and {@link #initialized}<br> 1265 * <b>NOTE:</b>DO NOT use the method in your code 1266 */ 1267 @ThriftField(name = "remark") 1268 public void writeRemark(String newVal){ 1269 checkMutable(); 1270 remark = newVal; 1271 } 1272 /** 1273 * Determines if the remark has been modified. 1274 * 1275 * @return true if the field has been modified, false if the field has not been modified 1276 */ 1277 public boolean checkRemarkModified() 1278 { 1279 return 0L != (modified & FL_PERSON_ID_REMARK_MASK); 1280 } 1281 1282 /** 1283 * Determines if the remark has been initialized.<br> 1284 * 1285 * It is useful to determine if a field is null on purpose or just because it has not been initialized. 1286 * 1287 * @return true if the field has been initialized, false otherwise 1288 */ 1289 public boolean checkRemarkInitialized() 1290 { 1291 return 0L != (initialized & FL_PERSON_ID_REMARK_MASK); 1292 } 1293 /** 1294 * Getter method for {@link #extBin}.<br> 1295 * Meta Data Information (in progress): 1296 * <ul> 1297 * <li>full name: fl_person.ext_bin</li> 1298 * <li>comments: 应用项目自定义二进制扩展字段(最大64KB)</li> 1299 * <li>column size: 65535</li> 1300 * <li>JDBC type returned by the driver: Types.LONGVARBINARY</li> 1301 * </ul> 1302 * 1303 * @return the value of extBin 1304 */ 1305 @ThriftField(value=18) 1306 public java.nio.ByteBuffer getExtBin(){ 1307 return extBin; 1308 } 1309 /** 1310 * Setter method for {@link #extBin}.<br> 1311 * The new value is set only if equals() says it is different, 1312 * or if one of either the new value or the current value is null. 1313 * In case the new value is different, it is set and the field is marked as 'modified'. 1314 * 1315 * @param newVal the new value to be assigned to extBin 1316 */ 1317 public void setExtBin(java.nio.ByteBuffer newVal) 1318 { 1319 checkMutable(); 1320 1321 modified |= FL_PERSON_ID_EXT_BIN_MASK; 1322 initialized |= FL_PERSON_ID_EXT_BIN_MASK; 1323 1324 if (Objects.equals(newVal, extBin)) { 1325 return; 1326 } 1327 extBin = newVal; 1328 } 1329 /** 1330 * setter for thrift:swift support<br> 1331 * without modification for {@link #modified} and {@link #initialized}<br> 1332 * <b>NOTE:</b>DO NOT use the method in your code 1333 */ 1334 @ThriftField(name = "extBin") 1335 public void writeExtBin(java.nio.ByteBuffer newVal){ 1336 checkMutable(); 1337 extBin = newVal; 1338 } 1339 /** 1340 * Determines if the extBin has been modified. 1341 * 1342 * @return true if the field has been modified, false if the field has not been modified 1343 */ 1344 public boolean checkExtBinModified() 1345 { 1346 return 0L != (modified & FL_PERSON_ID_EXT_BIN_MASK); 1347 } 1348 1349 /** 1350 * Determines if the extBin has been initialized.<br> 1351 * 1352 * It is useful to determine if a field is null on purpose or just because it has not been initialized. 1353 * 1354 * @return true if the field has been initialized, false otherwise 1355 */ 1356 public boolean checkExtBinInitialized() 1357 { 1358 return 0L != (initialized & FL_PERSON_ID_EXT_BIN_MASK); 1359 } 1360 /** 1361 * Getter method for {@link #extTxt}.<br> 1362 * Meta Data Information (in progress): 1363 * <ul> 1364 * <li>full name: fl_person.ext_txt</li> 1365 * <li>comments: 应用项目自定义文本扩展字段(最大64KB)</li> 1366 * <li>column size: 65535</li> 1367 * <li>JDBC type returned by the driver: Types.LONGVARCHAR</li> 1368 * </ul> 1369 * 1370 * @return the value of extTxt 1371 */ 1372 @ThriftField(value=19) 1373 public String getExtTxt(){ 1374 return extTxt; 1375 } 1376 /** 1377 * Setter method for {@link #extTxt}.<br> 1378 * The new value is set only if equals() says it is different, 1379 * or if one of either the new value or the current value is null. 1380 * In case the new value is different, it is set and the field is marked as 'modified'. 1381 * 1382 * @param newVal the new value to be assigned to extTxt 1383 */ 1384 public void setExtTxt(String newVal) 1385 { 1386 checkMutable(); 1387 1388 modified |= FL_PERSON_ID_EXT_TXT_MASK; 1389 initialized |= FL_PERSON_ID_EXT_TXT_MASK; 1390 1391 if (Objects.equals(newVal, extTxt)) { 1392 return; 1393 } 1394 extTxt = newVal; 1395 } 1396 /** 1397 * setter for thrift:swift support<br> 1398 * without modification for {@link #modified} and {@link #initialized}<br> 1399 * <b>NOTE:</b>DO NOT use the method in your code 1400 */ 1401 @ThriftField(name = "extTxt") 1402 public void writeExtTxt(String newVal){ 1403 checkMutable(); 1404 extTxt = newVal; 1405 } 1406 /** 1407 * Determines if the extTxt has been modified. 1408 * 1409 * @return true if the field has been modified, false if the field has not been modified 1410 */ 1411 public boolean checkExtTxtModified() 1412 { 1413 return 0L != (modified & FL_PERSON_ID_EXT_TXT_MASK); 1414 } 1415 1416 /** 1417 * Determines if the extTxt has been initialized.<br> 1418 * 1419 * It is useful to determine if a field is null on purpose or just because it has not been initialized. 1420 * 1421 * @return true if the field has been initialized, false otherwise 1422 */ 1423 public boolean checkExtTxtInitialized() 1424 { 1425 return 0L != (initialized & FL_PERSON_ID_EXT_TXT_MASK); 1426 } 1427 /** 1428 * Getter method for {@link #createTime}.<br> 1429 * Meta Data Information (in progress): 1430 * <ul> 1431 * <li>full name: fl_person.create_time</li> 1432 * <li>default value: 'CURRENT_TIMESTAMP'</li> 1433 * <li>NOT NULL</li> 1434 * <li>column size: 19</li> 1435 * <li>JDBC type returned by the driver: Types.TIMESTAMP</li> 1436 * </ul> 1437 * 1438 * @return the value of createTime 1439 */ 1440 public java.util.Date getCreateTime(){ 1441 return createTime; 1442 } 1443 /** 1444 * use Long to represent date type for thrift:swift support 1445 * @see #getCreateTime() 1446 */ 1447 @ThriftField(name = "createTime",value = 20) 1448 public Long readCreateTime(){ 1449 return null == createTime ? null:createTime.getTime(); 1450 } 1451 /** 1452 * Setter method for {@link #createTime}.<br> 1453 * The new value is set only if equals() says it is different, 1454 * or if one of either the new value or the current value is null. 1455 * In case the new value is different, it is set and the field is marked as 'modified'. 1456 * 1457 * @param newVal the new value( NOT NULL) to be assigned to createTime 1458 */ 1459 public void setCreateTime(java.util.Date newVal) 1460 { 1461 checkMutable(); 1462 1463 modified |= FL_PERSON_ID_CREATE_TIME_MASK; 1464 initialized |= FL_PERSON_ID_CREATE_TIME_MASK; 1465 1466 if (Objects.equals(newVal, createTime)) { 1467 return; 1468 } 1469 createTime = newVal; 1470 } 1471 /** 1472 * setter for thrift:swift support<br> 1473 * without modification for {@link #modified} and {@link #initialized}<br> 1474 * <b>NOTE:</b>DO NOT use the method in your code 1475 */ 1476 @ThriftField(name = "createTime") 1477 public void writeCreateTime(Long newVal){ 1478 checkMutable(); 1479 createTime = null == newVal?null:new java.util.Date(newVal); 1480 } 1481 /** 1482 * Setter method for {@link #createTime}.<br> 1483 * Convenient for those who do not want to deal with Objects for primary types. 1484 * 1485 * @param newVal the new value to be assigned to createTime 1486 */ 1487 public void setCreateTime(long newVal) 1488 { 1489 setCreateTime(new java.util.Date(newVal)); 1490 } 1491 /** 1492 * Setter method for {@link #createTime}.<br> 1493 * @param newVal the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this Date object. 1494 */ 1495 public void setCreateTime(Long newVal) 1496 { 1497 setCreateTime(null == newVal ? null : new java.util.Date(newVal)); 1498 } 1499 /** 1500 * Determines if the createTime has been modified. 1501 * 1502 * @return true if the field has been modified, false if the field has not been modified 1503 */ 1504 public boolean checkCreateTimeModified() 1505 { 1506 return 0L != (modified & FL_PERSON_ID_CREATE_TIME_MASK); 1507 } 1508 1509 /** 1510 * Determines if the createTime has been initialized.<br> 1511 * 1512 * It is useful to determine if a field is null on purpose or just because it has not been initialized. 1513 * 1514 * @return true if the field has been initialized, false otherwise 1515 */ 1516 public boolean checkCreateTimeInitialized() 1517 { 1518 return 0L != (initialized & FL_PERSON_ID_CREATE_TIME_MASK); 1519 } 1520 /** 1521 * Getter method for {@link #updateTime}.<br> 1522 * Meta Data Information (in progress): 1523 * <ul> 1524 * <li>full name: fl_person.update_time</li> 1525 * <li>default value: 'CURRENT_TIMESTAMP'</li> 1526 * <li>NOT NULL</li> 1527 * <li>column size: 19</li> 1528 * <li>JDBC type returned by the driver: Types.TIMESTAMP</li> 1529 * </ul> 1530 * 1531 * @return the value of updateTime 1532 */ 1533 public java.util.Date getUpdateTime(){ 1534 return updateTime; 1535 } 1536 /** 1537 * use Long to represent date type for thrift:swift support 1538 * @see #getUpdateTime() 1539 */ 1540 @ThriftField(name = "updateTime",value = 21) 1541 public Long readUpdateTime(){ 1542 return null == updateTime ? null:updateTime.getTime(); 1543 } 1544 /** 1545 * Setter method for {@link #updateTime}.<br> 1546 * The new value is set only if equals() says it is different, 1547 * or if one of either the new value or the current value is null. 1548 * In case the new value is different, it is set and the field is marked as 'modified'. 1549 * 1550 * @param newVal the new value( NOT NULL) to be assigned to updateTime 1551 */ 1552 public void setUpdateTime(java.util.Date newVal) 1553 { 1554 checkMutable(); 1555 1556 modified |= FL_PERSON_ID_UPDATE_TIME_MASK; 1557 initialized |= FL_PERSON_ID_UPDATE_TIME_MASK; 1558 1559 if (Objects.equals(newVal, updateTime)) { 1560 return; 1561 } 1562 updateTime = newVal; 1563 } 1564 /** 1565 * setter for thrift:swift support<br> 1566 * without modification for {@link #modified} and {@link #initialized}<br> 1567 * <b>NOTE:</b>DO NOT use the method in your code 1568 */ 1569 @ThriftField(name = "updateTime") 1570 public void writeUpdateTime(Long newVal){ 1571 checkMutable(); 1572 updateTime = null == newVal?null:new java.util.Date(newVal); 1573 } 1574 /** 1575 * Setter method for {@link #updateTime}.<br> 1576 * Convenient for those who do not want to deal with Objects for primary types. 1577 * 1578 * @param newVal the new value to be assigned to updateTime 1579 */ 1580 public void setUpdateTime(long newVal) 1581 { 1582 setUpdateTime(new java.util.Date(newVal)); 1583 } 1584 /** 1585 * Setter method for {@link #updateTime}.<br> 1586 * @param newVal the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this Date object. 1587 */ 1588 public void setUpdateTime(Long newVal) 1589 { 1590 setUpdateTime(null == newVal ? null : new java.util.Date(newVal)); 1591 } 1592 /** 1593 * Determines if the updateTime has been modified. 1594 * 1595 * @return true if the field has been modified, false if the field has not been modified 1596 */ 1597 public boolean checkUpdateTimeModified() 1598 { 1599 return 0L != (modified & FL_PERSON_ID_UPDATE_TIME_MASK); 1600 } 1601 1602 /** 1603 * Determines if the updateTime has been initialized.<br> 1604 * 1605 * It is useful to determine if a field is null on purpose or just because it has not been initialized. 1606 * 1607 * @return true if the field has been initialized, false otherwise 1608 */ 1609 public boolean checkUpdateTimeInitialized() 1610 { 1611 return 0L != (initialized & FL_PERSON_ID_UPDATE_TIME_MASK); 1612 } 1613 ////////////////////////////////////// 1614 // referenced bean for FOREIGN KEYS 1615 ////////////////////////////////////// 1616 /** 1617 * The referenced {@link ImageBean} by {@link #imageMd5} . <br> 1618 * FOREIGN KEY (image_md5) REFERENCES fl_image(md5) 1619 */ 1620 @ApiModelProperty(hidden = true) 1621 private ImageBean referencedByImageMd5; 1622 /** 1623 * Getter method for {@link #referencedByImageMd5}. 1624 * @return ImageBean 1625 */ 1626 public ImageBean getReferencedByImageMd5() { 1627 return this.referencedByImageMd5; 1628 } 1629 /** 1630 * Setter method for {@link #referencedByImageMd5}. 1631 * @param reference ImageBean 1632 */ 1633 public void setReferencedByImageMd5(ImageBean reference) { 1634 this.referencedByImageMd5 = reference; 1635 } 1636 /** 1637 * The referenced {@link PersonGroupBean} by {@link #groupId} . <br> 1638 * FOREIGN KEY (group_id) REFERENCES fl_person_group(id) 1639 */ 1640 @ApiModelProperty(hidden = true) 1641 private PersonGroupBean referencedByGroupId; 1642 /** 1643 * Getter method for {@link #referencedByGroupId}. 1644 * @return PersonGroupBean 1645 */ 1646 public PersonGroupBean getReferencedByGroupId() { 1647 return this.referencedByGroupId; 1648 } 1649 /** 1650 * Setter method for {@link #referencedByGroupId}. 1651 * @param reference PersonGroupBean 1652 */ 1653 public void setReferencedByGroupId(PersonGroupBean reference) { 1654 this.referencedByGroupId = reference; 1655 } 1656 1657 @Override 1658 public boolean isModified() 1659 { 1660 return 0 != modified; 1661 } 1662 1663 @Override 1664 public boolean isModified(int columnID){ 1665 switch ( columnID ){ 1666 case FL_PERSON_ID_ID: 1667 return checkIdModified(); 1668 case FL_PERSON_ID_GROUP_ID: 1669 return checkGroupIdModified(); 1670 case FL_PERSON_ID_NAME: 1671 return checkNameModified(); 1672 case FL_PERSON_ID_SEX: 1673 return checkSexModified(); 1674 case FL_PERSON_ID_RANK: 1675 return checkRankModified(); 1676 case FL_PERSON_ID_PASSWORD: 1677 return checkPasswordModified(); 1678 case FL_PERSON_ID_BIRTHDATE: 1679 return checkBirthdateModified(); 1680 case FL_PERSON_ID_MOBILE_PHONE: 1681 return checkMobilePhoneModified(); 1682 case FL_PERSON_ID_PAPERS_TYPE: 1683 return checkPapersTypeModified(); 1684 case FL_PERSON_ID_PAPERS_NUM: 1685 return checkPapersNumModified(); 1686 case FL_PERSON_ID_IMAGE_MD5: 1687 return checkImageMd5Modified(); 1688 case FL_PERSON_ID_EXPIRY_DATE: 1689 return checkExpiryDateModified(); 1690 case FL_PERSON_ID_ACTIVATED_DATE: 1691 return checkActivatedDateModified(); 1692 case FL_PERSON_ID_REMARK: 1693 return checkRemarkModified(); 1694 case FL_PERSON_ID_EXT_BIN: 1695 return checkExtBinModified(); 1696 case FL_PERSON_ID_EXT_TXT: 1697 return checkExtTxtModified(); 1698 case FL_PERSON_ID_CREATE_TIME: 1699 return checkCreateTimeModified(); 1700 case FL_PERSON_ID_UPDATE_TIME: 1701 return checkUpdateTimeModified(); 1702 default: 1703 return false; 1704 } 1705 } 1706 1707 @Override 1708 public boolean isInitialized(int columnID){ 1709 switch(columnID) { 1710 case FL_PERSON_ID_ID: 1711 return checkIdInitialized(); 1712 case FL_PERSON_ID_GROUP_ID: 1713 return checkGroupIdInitialized(); 1714 case FL_PERSON_ID_NAME: 1715 return checkNameInitialized(); 1716 case FL_PERSON_ID_SEX: 1717 return checkSexInitialized(); 1718 case FL_PERSON_ID_RANK: 1719 return checkRankInitialized(); 1720 case FL_PERSON_ID_PASSWORD: 1721 return checkPasswordInitialized(); 1722 case FL_PERSON_ID_BIRTHDATE: 1723 return checkBirthdateInitialized(); 1724 case FL_PERSON_ID_MOBILE_PHONE: 1725 return checkMobilePhoneInitialized(); 1726 case FL_PERSON_ID_PAPERS_TYPE: 1727 return checkPapersTypeInitialized(); 1728 case FL_PERSON_ID_PAPERS_NUM: 1729 return checkPapersNumInitialized(); 1730 case FL_PERSON_ID_IMAGE_MD5: 1731 return checkImageMd5Initialized(); 1732 case FL_PERSON_ID_EXPIRY_DATE: 1733 return checkExpiryDateInitialized(); 1734 case FL_PERSON_ID_ACTIVATED_DATE: 1735 return checkActivatedDateInitialized(); 1736 case FL_PERSON_ID_REMARK: 1737 return checkRemarkInitialized(); 1738 case FL_PERSON_ID_EXT_BIN: 1739 return checkExtBinInitialized(); 1740 case FL_PERSON_ID_EXT_TXT: 1741 return checkExtTxtInitialized(); 1742 case FL_PERSON_ID_CREATE_TIME: 1743 return checkCreateTimeInitialized(); 1744 case FL_PERSON_ID_UPDATE_TIME: 1745 return checkUpdateTimeInitialized(); 1746 default: 1747 return false; 1748 } 1749 } 1750 1751 @Override 1752 public boolean isModified(String column){ 1753 return isModified(columnIDOf(column)); 1754 } 1755 1756 @Override 1757 public boolean isInitialized(String column){ 1758 return isInitialized(columnIDOf(column)); 1759 } 1760 1761 @Override 1762 public void resetIsModified() 1763 { 1764 checkMutable(); 1765 modified = 0; 1766 } 1767 1768 @Override 1769 public void resetPrimaryKeysModified() 1770 { 1771 modified &= (~(FL_PERSON_ID_ID_MASK)); 1772 } 1773 /** 1774 * Resets columns modification status except primary keys to 'not modified'. 1775 */ 1776 public void resetModifiedExceptPrimaryKeys() 1777 { 1778 modified &= (~(FL_PERSON_ID_GROUP_ID_MASK | 1779 FL_PERSON_ID_NAME_MASK | 1780 FL_PERSON_ID_SEX_MASK | 1781 FL_PERSON_ID_RANK_MASK | 1782 FL_PERSON_ID_PASSWORD_MASK | 1783 FL_PERSON_ID_BIRTHDATE_MASK | 1784 FL_PERSON_ID_MOBILE_PHONE_MASK | 1785 FL_PERSON_ID_PAPERS_TYPE_MASK | 1786 FL_PERSON_ID_PAPERS_NUM_MASK | 1787 FL_PERSON_ID_IMAGE_MD5_MASK | 1788 FL_PERSON_ID_EXPIRY_DATE_MASK | 1789 FL_PERSON_ID_ACTIVATED_DATE_MASK | 1790 FL_PERSON_ID_REMARK_MASK | 1791 FL_PERSON_ID_EXT_BIN_MASK | 1792 FL_PERSON_ID_EXT_TXT_MASK | 1793 FL_PERSON_ID_CREATE_TIME_MASK | 1794 FL_PERSON_ID_UPDATE_TIME_MASK)); 1795 } 1796 /** 1797 * Resets the object initialization status to 'not initialized'. 1798 */ 1799 private void resetInitialized() 1800 { 1801 initialized = 0; 1802 } 1803 /** reset all fields to initial value, equal to a new bean */ 1804 public void reset(){ 1805 checkMutable(); 1806 this.id = null; 1807 /* DEFAULT:'1'*/ 1808 this.groupId = new Integer(1); 1809 this.name = null; 1810 this.sex = null; 1811 this.rank = null; 1812 this.password = null; 1813 this.birthdate = null; 1814 this.mobilePhone = null; 1815 this.papersType = null; 1816 this.papersNum = null; 1817 this.imageMd5 = null; 1818 /* DEFAULT:'2050-12-31'*/ 1819 this.expiryDate = new java.text.SimpleDateFormat("yyyy-MM-dd").parse("2050-12-31",new java.text.ParsePosition(0)); 1820 this.activatedDate = null; 1821 this.remark = null; 1822 this.extBin = null; 1823 this.extTxt = null; 1824 /* DEFAULT:'CURRENT_TIMESTAMP'*/ 1825 this.createTime = null; 1826 /* DEFAULT:'CURRENT_TIMESTAMP'*/ 1827 this.updateTime = null; 1828 this.isNew = true; 1829 this.modified = 0; 1830 this.initialized = (FL_PERSON_ID_GROUP_ID_MASK | FL_PERSON_ID_EXPIRY_DATE_MASK); 1831 } 1832 @Override 1833 public boolean equals(Object object) 1834 { 1835 if (!(object instanceof PersonBean)) { 1836 return false; 1837 } 1838 1839 PersonBean obj = (PersonBean) object; 1840 return new EqualsBuilder() 1841 .append(getId(), obj.getId()) 1842 .append(getGroupId(), obj.getGroupId()) 1843 .append(getName(), obj.getName()) 1844 .append(getSex(), obj.getSex()) 1845 .append(getRank(), obj.getRank()) 1846 .append(getPassword(), obj.getPassword()) 1847 .append(getBirthdate(), obj.getBirthdate()) 1848 .append(getMobilePhone(), obj.getMobilePhone()) 1849 .append(getPapersType(), obj.getPapersType()) 1850 .append(getPapersNum(), obj.getPapersNum()) 1851 .append(getImageMd5(), obj.getImageMd5()) 1852 .append(getExpiryDate(), obj.getExpiryDate()) 1853 .append(getActivatedDate(), obj.getActivatedDate()) 1854 .append(getRemark(), obj.getRemark()) 1855 .append(getExtBin(), obj.getExtBin()) 1856 .append(getExtTxt(), obj.getExtTxt()) 1857 .append(getCreateTime(), obj.getCreateTime()) 1858 .append(getUpdateTime(), obj.getUpdateTime()) 1859 .isEquals(); 1860 } 1861 1862 @Override 1863 public int hashCode() 1864 { 1865 return new HashCodeBuilder(-82280557, -700257973) 1866 .append(getId()) 1867 .toHashCode(); 1868 } 1869 1870 @Override 1871 public String toString() { 1872 return toString(true,false); 1873 } 1874 /** 1875 * cast byte array to HEX string 1876 * 1877 * @param input 1878 * @return {@code null} if {@code input} is null 1879 */ 1880 private static final String toHex(byte[] input) { 1881 if (null == input){ 1882 return null; 1883 } 1884 StringBuffer sb = new StringBuffer(input.length * 2); 1885 for (int i = 0; i < input.length; i++) { 1886 sb.append(Character.forDigit((input[i] & 240) >> 4, 16)); 1887 sb.append(Character.forDigit(input[i] & 15, 16)); 1888 } 1889 return sb.toString(); 1890 } 1891 protected static final StringBuilder append(StringBuilder buffer,boolean full,byte[] value){ 1892 if(full || null == value){ 1893 buffer.append(toHex(value)); 1894 }else{ 1895 buffer.append(value.length).append(" bytes"); 1896 } 1897 return buffer; 1898 } 1899 private static int stringLimit = 64; 1900 private static final int MINIMUM_LIMIT = 16; 1901 protected static final StringBuilder append(StringBuilder buffer,boolean full,String value){ 1902 if(full || null == value || value.length() <= stringLimit){ 1903 buffer.append(value); 1904 }else{ 1905 buffer.append(value.substring(0,stringLimit - 8)).append(" ...").append(value.substring(stringLimit-4,stringLimit)); 1906 } 1907 return buffer; 1908 } 1909 protected static final <T>StringBuilder append(StringBuilder buffer,boolean full,T value){ 1910 return buffer.append(value); 1911 } 1912 public static final void setStringLimit(int limit){ 1913 if(limit < MINIMUM_LIMIT){ 1914 throw new IllegalArgumentException(String.format("INVALID limit %d,minimum value %d",limit,MINIMUM_LIMIT)); 1915 } 1916 stringLimit = limit; 1917 } 1918 @Override 1919 public String toString(boolean notNull, boolean fullIfStringOrBytes) { 1920 // only output initialized field 1921 StringBuilder builder = new StringBuilder(this.getClass().getName()).append("@").append(Integer.toHexString(this.hashCode())).append("["); 1922 int count = 0; 1923 if(checkIdInitialized()){ 1924 if(!notNull || null != getId()){ 1925 if(count++ >0){ 1926 builder.append(","); 1927 } 1928 builder.append("id="); 1929 append(builder,fullIfStringOrBytes,getId()); 1930 } 1931 } 1932 if(checkGroupIdInitialized()){ 1933 if(!notNull || null != getGroupId()){ 1934 if(count++ >0){ 1935 builder.append(","); 1936 } 1937 builder.append("group_id="); 1938 append(builder,fullIfStringOrBytes,getGroupId()); 1939 } 1940 } 1941 if(checkNameInitialized()){ 1942 if(!notNull || null != getName()){ 1943 if(count++ >0){ 1944 builder.append(","); 1945 } 1946 builder.append("name="); 1947 append(builder,fullIfStringOrBytes,getName()); 1948 } 1949 } 1950 if(checkSexInitialized()){ 1951 if(!notNull || null != getSex()){ 1952 if(count++ >0){ 1953 builder.append(","); 1954 } 1955 builder.append("sex="); 1956 append(builder,fullIfStringOrBytes,getSex()); 1957 } 1958 } 1959 if(checkRankInitialized()){ 1960 if(!notNull || null != getRank()){ 1961 if(count++ >0){ 1962 builder.append(","); 1963 } 1964 builder.append("rank="); 1965 append(builder,fullIfStringOrBytes,getRank()); 1966 } 1967 } 1968 if(checkPasswordInitialized()){ 1969 if(!notNull || null != getPassword()){ 1970 if(count++ >0){ 1971 builder.append(","); 1972 } 1973 builder.append("password="); 1974 append(builder,fullIfStringOrBytes,getPassword()); 1975 } 1976 } 1977 if(checkBirthdateInitialized()){ 1978 if(!notNull || null != getBirthdate()){ 1979 if(count++ >0){ 1980 builder.append(","); 1981 } 1982 builder.append("birthdate="); 1983 append(builder,fullIfStringOrBytes,getBirthdate()); 1984 } 1985 } 1986 if(checkMobilePhoneInitialized()){ 1987 if(!notNull || null != getMobilePhone()){ 1988 if(count++ >0){ 1989 builder.append(","); 1990 } 1991 builder.append("mobile_phone="); 1992 append(builder,fullIfStringOrBytes,getMobilePhone()); 1993 } 1994 } 1995 if(checkPapersTypeInitialized()){ 1996 if(!notNull || null != getPapersType()){ 1997 if(count++ >0){ 1998 builder.append(","); 1999 } 2000 builder.append("papers_type="); 2001 append(builder,fullIfStringOrBytes,getPapersType()); 2002 } 2003 } 2004 if(checkPapersNumInitialized()){ 2005 if(!notNull || null != getPapersNum()){ 2006 if(count++ >0){ 2007 builder.append(","); 2008 } 2009 builder.append("papers_num="); 2010 append(builder,fullIfStringOrBytes,getPapersNum()); 2011 } 2012 } 2013 if(checkImageMd5Initialized()){ 2014 if(!notNull || null != getImageMd5()){ 2015 if(count++ >0){ 2016 builder.append(","); 2017 } 2018 builder.append("image_md5="); 2019 append(builder,fullIfStringOrBytes,getImageMd5()); 2020 } 2021 } 2022 if(checkExpiryDateInitialized()){ 2023 if(!notNull || null != getExpiryDate()){ 2024 if(count++ >0){ 2025 builder.append(","); 2026 } 2027 builder.append("expiry_date="); 2028 append(builder,fullIfStringOrBytes,getExpiryDate()); 2029 } 2030 } 2031 if(checkActivatedDateInitialized()){ 2032 if(!notNull || null != getActivatedDate()){ 2033 if(count++ >0){ 2034 builder.append(","); 2035 } 2036 builder.append("activated_date="); 2037 append(builder,fullIfStringOrBytes,getActivatedDate()); 2038 } 2039 } 2040 if(checkRemarkInitialized()){ 2041 if(!notNull || null != getRemark()){ 2042 if(count++ >0){ 2043 builder.append(","); 2044 } 2045 builder.append("remark="); 2046 append(builder,fullIfStringOrBytes,getRemark()); 2047 } 2048 } 2049 if(checkExtBinInitialized()){ 2050 if(!notNull || null != getExtBin()){ 2051 if(count++ >0){ 2052 builder.append(","); 2053 } 2054 builder.append("ext_bin="); 2055 append(builder,fullIfStringOrBytes,getExtBin()); 2056 } 2057 } 2058 if(checkExtTxtInitialized()){ 2059 if(!notNull || null != getExtTxt()){ 2060 if(count++ >0){ 2061 builder.append(","); 2062 } 2063 builder.append("ext_txt="); 2064 append(builder,fullIfStringOrBytes,getExtTxt()); 2065 } 2066 } 2067 if(checkCreateTimeInitialized()){ 2068 if(!notNull || null != getCreateTime()){ 2069 if(count++ >0){ 2070 builder.append(","); 2071 } 2072 builder.append("create_time="); 2073 append(builder,fullIfStringOrBytes,getCreateTime()); 2074 } 2075 } 2076 if(checkUpdateTimeInitialized()){ 2077 if(!notNull || null != getUpdateTime()){ 2078 if(count++ >0){ 2079 builder.append(","); 2080 } 2081 builder.append("update_time="); 2082 append(builder,fullIfStringOrBytes,getUpdateTime()); 2083 } 2084 } 2085 builder.append("]"); 2086 return builder.toString(); 2087 } 2088 @Override 2089 public int compareTo(PersonBean object){ 2090 return new CompareToBuilder() 2091 .append(getId(), object.getId()) 2092 .append(getGroupId(), object.getGroupId()) 2093 .append(getName(), object.getName()) 2094 .append(getSex(), object.getSex()) 2095 .append(getRank(), object.getRank()) 2096 .append(getPassword(), object.getPassword()) 2097 .append(getBirthdate(), object.getBirthdate()) 2098 .append(getMobilePhone(), object.getMobilePhone()) 2099 .append(getPapersType(), object.getPapersType()) 2100 .append(getPapersNum(), object.getPapersNum()) 2101 .append(getImageMd5(), object.getImageMd5()) 2102 .append(getExpiryDate(), object.getExpiryDate()) 2103 .append(getActivatedDate(), object.getActivatedDate()) 2104 .append(getRemark(), object.getRemark()) 2105 .append(getExtBin(), object.getExtBin()) 2106 .append(getExtTxt(), object.getExtTxt()) 2107 .append(getCreateTime(), object.getCreateTime()) 2108 .append(getUpdateTime(), object.getUpdateTime()) 2109 .toComparison(); 2110 } 2111 @Override 2112 public PersonBean clone(){ 2113 try { 2114 return (PersonBean) super.clone(); 2115 } catch (CloneNotSupportedException e) { 2116 throw new RuntimeException(e); 2117 } 2118 } 2119 /** 2120 * Make {@code this} to a NULL bean<br> 2121 * set all fields to null, {@link #modified} and {@link #initialized} be set to 0 2122 * @return {@code this} bean 2123 * @author guyadong 2124 */ 2125 public PersonBean asNULL() 2126 { 2127 checkMutable(); 2128 2129 setId((Integer)null); 2130 setGroupId((Integer)null); 2131 setName((String)null); 2132 setSex((Integer)null); 2133 setRank((Integer)null); 2134 setPassword((String)null); 2135 setBirthdate((java.util.Date)null); 2136 setMobilePhone((String)null); 2137 setPapersType((Integer)null); 2138 setPapersNum((String)null); 2139 setImageMd5((String)null); 2140 setExpiryDate((java.util.Date)null); 2141 setActivatedDate((java.util.Date)null); 2142 setRemark((String)null); 2143 setExtBin((java.nio.ByteBuffer)null); 2144 setExtTxt((String)null); 2145 setCreateTime((java.util.Date)null); 2146 setUpdateTime((java.util.Date)null); 2147 isNew(true); 2148 resetInitialized(); 2149 resetIsModified(); 2150 return this; 2151 } 2152 /** 2153 * check whether this bean is a NULL bean 2154 * @return {@code true} if {@link #initialized} be set to zero 2155 * @see #asNULL() 2156 */ 2157 public boolean checkNULL(){ 2158 return 0 == getInitialized(); 2159 } 2160 /** 2161 * @param source source list 2162 * @return {@code source} replace {@code null} element with null instance({@link #NULL}) 2163 */ 2164 public static final List<PersonBean> replaceNull(List<PersonBean> source){ 2165 if(null != source){ 2166 for(int i = 0,endIndex = source.size();i<endIndex;++i){ 2167 if(null == source.get(i)){ 2168 source.set(i, NULL); 2169 } 2170 } 2171 } 2172 return source; 2173 } 2174 /** 2175 * @param source input list 2176 * @return replace null instance element with {@code null} 2177 * @see #checkNULL() 2178 */ 2179 public static final List<PersonBean> replaceNullInstance(List<PersonBean> source){ 2180 if(null != source){ 2181 for(int i = 0,endIndex = source.size();i<endIndex;++i){ 2182 if(source.get(i).checkNULL()){ 2183 source.set(i, null); 2184 } 2185 } 2186 } 2187 return source; 2188 } 2189 @Override 2190 public PersonBean copy(PersonBean bean) 2191 { 2192 return copy(bean,new int[]{}); 2193 } 2194 @Override 2195 public PersonBean copy(PersonBean bean, int... fieldList) 2196 { 2197 if (null == fieldList || 0 == fieldList.length){ 2198 fieldList = new int[]{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17}; 2199 } 2200 for (int i = 0; i < fieldList.length; ++i) { 2201 if( bean.isInitialized(fieldList[i]) && !Objects.deepEquals(bean.getValue(fieldList[i]), getValue(fieldList[i]))){ 2202 setValue(fieldList[i], bean.getValue(fieldList[i])); 2203 } 2204 } 2205 return this; 2206 } 2207 2208 @Override 2209 public PersonBean copy(PersonBean bean, String... fieldList) 2210 { 2211 if (null == fieldList || 0 == fieldList.length){ 2212 copy(bean,(int[])null); 2213 }else{ 2214 int field; 2215 for (int i = 0; i < fieldList.length; i++) { 2216 field = columnIDOf(fieldList[i].trim()); 2217 if(bean.isInitialized(field) && !Objects.deepEquals(bean.getValue(field), getValue(field))){ 2218 setValue(field, bean.getValue(field)); 2219 } 2220 } 2221 } 2222 return this; 2223 } 2224 2225 @SuppressWarnings("unchecked") 2226 @Override 2227 public <T>T getValue(int columnID) 2228 { 2229 switch( columnID ){ 2230 case FL_PERSON_ID_ID: 2231 return (T)getId(); 2232 case FL_PERSON_ID_GROUP_ID: 2233 return (T)getGroupId(); 2234 case FL_PERSON_ID_NAME: 2235 return (T)getName(); 2236 case FL_PERSON_ID_SEX: 2237 return (T)getSex(); 2238 case FL_PERSON_ID_RANK: 2239 return (T)getRank(); 2240 case FL_PERSON_ID_PASSWORD: 2241 return (T)getPassword(); 2242 case FL_PERSON_ID_BIRTHDATE: 2243 return (T)getBirthdate(); 2244 case FL_PERSON_ID_MOBILE_PHONE: 2245 return (T)getMobilePhone(); 2246 case FL_PERSON_ID_PAPERS_TYPE: 2247 return (T)getPapersType(); 2248 case FL_PERSON_ID_PAPERS_NUM: 2249 return (T)getPapersNum(); 2250 case FL_PERSON_ID_IMAGE_MD5: 2251 return (T)getImageMd5(); 2252 case FL_PERSON_ID_EXPIRY_DATE: 2253 return (T)getExpiryDate(); 2254 case FL_PERSON_ID_ACTIVATED_DATE: 2255 return (T)getActivatedDate(); 2256 case FL_PERSON_ID_REMARK: 2257 return (T)getRemark(); 2258 case FL_PERSON_ID_EXT_BIN: 2259 return (T)getExtBin(); 2260 case FL_PERSON_ID_EXT_TXT: 2261 return (T)getExtTxt(); 2262 case FL_PERSON_ID_CREATE_TIME: 2263 return (T)getCreateTime(); 2264 case FL_PERSON_ID_UPDATE_TIME: 2265 return (T)getUpdateTime(); 2266 default: 2267 return null; 2268 } 2269 } 2270 2271 @Override 2272 public <T> void setValue(int columnID,T value) 2273 { 2274 switch( columnID ) { 2275 case FL_PERSON_ID_ID: 2276 setId((Integer)value); 2277 break; 2278 case FL_PERSON_ID_GROUP_ID: 2279 setGroupId((Integer)value); 2280 break; 2281 case FL_PERSON_ID_NAME: 2282 setName((String)value); 2283 break; 2284 case FL_PERSON_ID_SEX: 2285 setSex((Integer)value); 2286 break; 2287 case FL_PERSON_ID_RANK: 2288 setRank((Integer)value); 2289 break; 2290 case FL_PERSON_ID_PASSWORD: 2291 setPassword((String)value); 2292 break; 2293 case FL_PERSON_ID_BIRTHDATE: 2294 setBirthdate((java.util.Date)value); 2295 break; 2296 case FL_PERSON_ID_MOBILE_PHONE: 2297 setMobilePhone((String)value); 2298 break; 2299 case FL_PERSON_ID_PAPERS_TYPE: 2300 setPapersType((Integer)value); 2301 break; 2302 case FL_PERSON_ID_PAPERS_NUM: 2303 setPapersNum((String)value); 2304 break; 2305 case FL_PERSON_ID_IMAGE_MD5: 2306 setImageMd5((String)value); 2307 break; 2308 case FL_PERSON_ID_EXPIRY_DATE: 2309 setExpiryDate((java.util.Date)value); 2310 break; 2311 case FL_PERSON_ID_ACTIVATED_DATE: 2312 setActivatedDate((java.util.Date)value); 2313 break; 2314 case FL_PERSON_ID_REMARK: 2315 setRemark((String)value); 2316 break; 2317 case FL_PERSON_ID_EXT_BIN: 2318 setExtBin((java.nio.ByteBuffer)value); 2319 break; 2320 case FL_PERSON_ID_EXT_TXT: 2321 setExtTxt((String)value); 2322 break; 2323 case FL_PERSON_ID_CREATE_TIME: 2324 setCreateTime((java.util.Date)value); 2325 break; 2326 case FL_PERSON_ID_UPDATE_TIME: 2327 setUpdateTime((java.util.Date)value); 2328 break; 2329 default: 2330 break; 2331 } 2332 } 2333 2334 @Override 2335 public <T> T getValue(String column) 2336 { 2337 return getValue(columnIDOf(column)); 2338 } 2339 2340 @Override 2341 public <T> void setValue(String column,T value) 2342 { 2343 setValue(columnIDOf(column),value); 2344 } 2345 2346 /** 2347 * @param column column name 2348 * @return column id for the given field name or negative if {@code column} is invalid name 2349 */ 2350 public static int columnIDOf(String column){ 2351 int index = FL_PERSON_FIELDS_LIST.indexOf(column); 2352 return index < 0 2353 ? FL_PERSON_JAVA_FIELDS_LIST.indexOf(column) 2354 : index; 2355 } 2356 2357 public static String columnNameOf(int columnId){ 2358 try{ 2359 return FL_PERSON_FIELDS_LIST.get(columnId); 2360 } catch(IndexOutOfBoundsException e){ 2361 return null; 2362 } 2363 } 2364 2365 public static Class<?> typeOf(int columnId){ 2366 try{ 2367 return FL_PERSON_FIELD_TYPES[columnId]; 2368 } catch(IndexOutOfBoundsException e){ 2369 return null; 2370 } 2371 } 2372 2373 public static final Builder builder(){ 2374 return new Builder().reset(); 2375 } 2376 /** 2377 * a builder for PersonBean,the template instance is thread local variable 2378 * a instance of Builder can be reused. 2379 */ 2380 public static final class Builder{ 2381 /** PersonBean instance used for template to create new PersonBean instance. */ 2382 static final ThreadLocal<PersonBean> TEMPLATE = new ThreadLocal<PersonBean>(){ 2383 @Override 2384 protected PersonBean initialValue() { 2385 return new PersonBean(); 2386 }}; 2387 private Builder() {} 2388 /** 2389 * reset the bean as template 2390 * @see PersonBean#reset() 2391 */ 2392 public Builder reset(){ 2393 TEMPLATE.get().reset(); 2394 return this; 2395 } 2396 /** set a bean as template,must not be {@code null} */ 2397 public Builder template(PersonBean bean){ 2398 if(null == bean){ 2399 throw new NullPointerException(); 2400 } 2401 TEMPLATE.set(bean); 2402 return this; 2403 } 2404 /** return a clone instance of {@link #TEMPLATE}*/ 2405 public PersonBean build(){ 2406 return TEMPLATE.get().clone(); 2407 } 2408 /** 2409 * fill the field : fl_person.id 2410 * @param id 用户id 2411 * @see PersonBean#getId() 2412 * @see PersonBean#setId(Integer) 2413 */ 2414 public Builder id(Integer id){ 2415 TEMPLATE.get().setId(id); 2416 return this; 2417 } 2418 /** 2419 * fill the field : fl_person.group_id 2420 * @param groupId 所属用户组id 2421 * @see PersonBean#getGroupId() 2422 * @see PersonBean#setGroupId(Integer) 2423 */ 2424 public Builder groupId(Integer groupId){ 2425 TEMPLATE.get().setGroupId(groupId); 2426 return this; 2427 } 2428 /** 2429 * fill the field : fl_person.name 2430 * @param name 姓名 2431 * @see PersonBean#getName() 2432 * @see PersonBean#setName(String) 2433 */ 2434 public Builder name(String name){ 2435 TEMPLATE.get().setName(name); 2436 return this; 2437 } 2438 /** 2439 * fill the field : fl_person.sex 2440 * @param sex 性别,0:女,1:男,其他:未定义 2441 * @see PersonBean#getSex() 2442 * @see PersonBean#setSex(Integer) 2443 */ 2444 public Builder sex(Integer sex){ 2445 TEMPLATE.get().setSex(sex); 2446 return this; 2447 } 2448 /** 2449 * fill the field : fl_person.rank 2450 * @param rank 用户级别,NULL,0:普通用户,2:操作员,3:管理员,其他:未定义 2451 * @see PersonBean#getRank() 2452 * @see PersonBean#setRank(Integer) 2453 */ 2454 public Builder rank(Integer rank){ 2455 TEMPLATE.get().setRank(rank); 2456 return this; 2457 } 2458 /** 2459 * fill the field : fl_person.password 2460 * @param password 用户密码,MD5 2461 * @see PersonBean#getPassword() 2462 * @see PersonBean#setPassword(String) 2463 */ 2464 public Builder password(String password){ 2465 TEMPLATE.get().setPassword(password); 2466 return this; 2467 } 2468 /** 2469 * fill the field : fl_person.birthdate 2470 * @param birthdate 出生日期 2471 * @see PersonBean#getBirthdate() 2472 * @see PersonBean#setBirthdate(java.util.Date) 2473 */ 2474 public Builder birthdate(java.util.Date birthdate){ 2475 TEMPLATE.get().setBirthdate(birthdate); 2476 return this; 2477 } 2478 /** 2479 * fill the field : fl_person.mobile_phone 2480 * @param mobilePhone 手机号码 2481 * @see PersonBean#getMobilePhone() 2482 * @see PersonBean#setMobilePhone(String) 2483 */ 2484 public Builder mobilePhone(String mobilePhone){ 2485 TEMPLATE.get().setMobilePhone(mobilePhone); 2486 return this; 2487 } 2488 /** 2489 * fill the field : fl_person.papers_type 2490 * @param papersType 证件类型,0:未知,1:身份证,2:护照,3:台胞证,4:港澳通行证,5:军官证,6:外国人居留证,7:员工卡,8:其他 2491 * @see PersonBean#getPapersType() 2492 * @see PersonBean#setPapersType(Integer) 2493 */ 2494 public Builder papersType(Integer papersType){ 2495 TEMPLATE.get().setPapersType(papersType); 2496 return this; 2497 } 2498 /** 2499 * fill the field : fl_person.papers_num 2500 * @param papersNum 证件号码 2501 * @see PersonBean#getPapersNum() 2502 * @see PersonBean#setPapersNum(String) 2503 */ 2504 public Builder papersNum(String papersNum){ 2505 TEMPLATE.get().setPapersNum(papersNum); 2506 return this; 2507 } 2508 /** 2509 * fill the field : fl_person.image_md5 2510 * @param imageMd5 用户默认照片(证件照,标准照)的md5校验码,外键 2511 * @see PersonBean#getImageMd5() 2512 * @see PersonBean#setImageMd5(String) 2513 */ 2514 public Builder imageMd5(String imageMd5){ 2515 TEMPLATE.get().setImageMd5(imageMd5); 2516 return this; 2517 } 2518 /** 2519 * fill the field : fl_person.expiry_date 2520 * @param expiryDate 验证有效期限(超过期限不能通过验证),为NULL永久有效 2521 * @see PersonBean#getExpiryDate() 2522 * @see PersonBean#setExpiryDate(java.util.Date) 2523 */ 2524 public Builder expiryDate(java.util.Date expiryDate){ 2525 TEMPLATE.get().setExpiryDate(expiryDate); 2526 return this; 2527 } 2528 /** 2529 * fill the field : fl_person.activated_date 2530 * @param activatedDate 帐户激活日期,为NULL时,create_time字段即为激活日期 2531 * @see PersonBean#getActivatedDate() 2532 * @see PersonBean#setActivatedDate(java.util.Date) 2533 */ 2534 public Builder activatedDate(java.util.Date activatedDate){ 2535 TEMPLATE.get().setActivatedDate(activatedDate); 2536 return this; 2537 } 2538 /** 2539 * fill the field : fl_person.remark 2540 * @param remark 备注 2541 * @see PersonBean#getRemark() 2542 * @see PersonBean#setRemark(String) 2543 */ 2544 public Builder remark(String remark){ 2545 TEMPLATE.get().setRemark(remark); 2546 return this; 2547 } 2548 /** 2549 * fill the field : fl_person.ext_bin 2550 * @param extBin 应用项目自定义二进制扩展字段(最大64KB) 2551 * @see PersonBean#getExtBin() 2552 * @see PersonBean#setExtBin(java.nio.ByteBuffer) 2553 */ 2554 public Builder extBin(java.nio.ByteBuffer extBin){ 2555 TEMPLATE.get().setExtBin(extBin); 2556 return this; 2557 } 2558 /** 2559 * fill the field : fl_person.ext_txt 2560 * @param extTxt 应用项目自定义文本扩展字段(最大64KB) 2561 * @see PersonBean#getExtTxt() 2562 * @see PersonBean#setExtTxt(String) 2563 */ 2564 public Builder extTxt(String extTxt){ 2565 TEMPLATE.get().setExtTxt(extTxt); 2566 return this; 2567 } 2568 /** 2569 * fill the field : fl_person.create_time 2570 * @param createTime 2571 * @see PersonBean#getCreateTime() 2572 * @see PersonBean#setCreateTime(java.util.Date) 2573 */ 2574 public Builder createTime(java.util.Date createTime){ 2575 TEMPLATE.get().setCreateTime(createTime); 2576 return this; 2577 } 2578 /** 2579 * fill the field : fl_person.update_time 2580 * @param updateTime 2581 * @see PersonBean#getUpdateTime() 2582 * @see PersonBean#setUpdateTime(java.util.Date) 2583 */ 2584 public Builder updateTime(java.util.Date updateTime){ 2585 TEMPLATE.get().setUpdateTime(updateTime); 2586 return this; 2587 } 2588 } 2589}