java.ftl 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. package ${package};
  2. import inbasis.system.IBOBaseObject;
  3. public class ${classname} extends IBOBaseObject
  4. implements java.io.Serializable
  5. {
  6. private Long id;
  7. //Fields
  8. <#list fields as field>
  9. private ${field.type} ${field.name};
  10. </#list>
  11. /** default constructor */
  12. public ${classname}(){}
  13. public Long getId() {
  14. return this.id;
  15. }
  16. public void setId(Long id) {
  17. this.id = id;
  18. }
  19. //Property accessors
  20. <#list fields as field>
  21. /**
  22. * ${field.title}
  23. * @return ${field.type}
  24. */
  25. public ${field.type} get${field.name?cap_first}() {
  26. <#if field.type == "java.lang.String">
  27. if(this.${field.name}==null || this.${field.name}.length()<=0)
  28. return null;
  29. else
  30. return this.${field.name};
  31. <#else>
  32. return this.${field.name};
  33. </#if>
  34. }
  35. /**
  36. * ${field.title}
  37. * @return ${field.type}
  38. */
  39. public void set${field.name?cap_first}(${field.type} ${field.name}) {
  40. this.${field.name} = ${field.name};
  41. }
  42. </#list>
  43. }