Advertisement
Guest User

Untitled

a guest
Mar 29th, 2015
294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. switch(property.getType()) {
  2. case INTEGER:
  3. type = "INTEGER"; break;
  4. case REAL:
  5. type = "REAL"; break;
  6. default:
  7. type = "VARCHAR";
  8. if(property.hasConstraint(Length.class)==true)
  9. out.printf("(%s)", property.getConstraint(Length.class).getMaxLength());
  10. else
  11. out.printf("(50)");
  12. }
  13. if(property.hasConstraint(Required.class)==true) {
  14. String a = "NOT NULL";
  15. out.printf(",%s %s %s\n", property.getName(), type, a);
  16. }
  17. else
  18. out.printf(",%s %s\n", property.getName(), type);
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement