org.genericdao
Annotation Type MaxSize


@Retention(value=RUNTIME)
@Target(value=FIELD)
public @interface MaxSize

The annotation used specify the maximum length of a String property stored in the database. If this annotation is not provided, the default maximum string that be stored for is 255 characters.

Here is a simple example:

     @PrimaryKey("id")
     public class Customer {
         private int    id;

         @MaxSize(20)
         private String firstName;

         @MaxSize(30)
         private String lastName;

         @MaxSize(1000)
         private String comment;

         public int     getId()        { return id;        }
         public String  getFirstName() { return firstName; }
         public String  getLastName()  { return lastName;  }
         public String  getComment()   { return comment;   }

         public void setId(int i)           { id = i; }
         public void setFirstName(String s) { firstName = s; }
         public void setLastName(String s)  { lastName  = s; }
         public void setComment(String s)   { comment   = s; }
     }
 


Required Element Summary
 int value
           
 

Element Detail

value

public abstract int value


Copyright © 2012 Jeffrey L. Eppinger. All rights reserved. Permission granted for educational use only.