blob.ftl 966 B

1234567891011121314151617181920212223242526272829303132333435
  1. <#if po.fieldDbType=='Blob'>
  2. private transient java.lang.String ${po.fieldName}String;
  3. private byte[] ${po.fieldName};
  4. public byte[] get${po.fieldName?cap_first}(){
  5. if(${po.fieldName}String==null){
  6. return null;
  7. }
  8. try {
  9. return ${po.fieldName}String.getBytes("UTF-8");
  10. } catch (UnsupportedEncodingException e) {
  11. e.printStackTrace();
  12. }
  13. return null;
  14. }
  15. public String get${po.fieldName?cap_first}String(){
  16. if(${po.fieldName}==null || ${po.fieldName}.length==0){
  17. return "";
  18. }
  19. try {
  20. return new String(${po.fieldName},"UTF-8");
  21. } catch (UnsupportedEncodingException e) {
  22. e.printStackTrace();
  23. }
  24. return "";
  25. }
  26. <#else>
  27. @ApiModelProperty(value = "${po.filedComment}")
  28. <#if po.fieldDbName == 'del_flag'>
  29. @TableLogic
  30. </#if>
  31. private ${po.fieldType} ${po.fieldName};
  32. </#if>