net.sf.persism.annotations
Annotation Type Column


@Retention(value=RUNTIME)
@Target(value={METHOD,FIELD})
public @interface Column

Optional annotation defining a column mapping for a property on the class. This annotation can appear on the class field, getter or setter.


Optional Element Summary
 boolean generated
          Indicates if the column is generated in the database - like an auto increment field.
 boolean hasDefault
          Indicates that this column has a default value in the database.
 boolean primary
          Indicates that this column is a primary key.
 java.lang.String value
          Name of the column mapped to the property.
 

value

public abstract java.lang.String value
Name of the column mapped to the property. Used when the property cannot be auto-mapped to a table column.

It's only required if Persism cannot discover the column/property mapping on its own.

Default:
""

generated

public abstract boolean generated
Indicates if the column is generated in the database - like an auto increment field. This will tell Persism to exclude this column in insert/update statements and to update the object with this value after an insert.

It's only required if Persism cannot detect this column attribute on its own.

Default:
false

primary

public abstract boolean primary
Indicates that this column is a primary key.

It's only required if Persism cannot detect this column attribute on its own.

Default:
false

hasDefault

public abstract boolean hasDefault
Indicates that this column has a default value in the database. This tells Persism that if the data object did not specify a value then Persism will update the data object with the default after an insert.

It's only required if Persism cannot detect this column attribute on its own.

Default:
false