|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
@Retention(value=RUNTIME) @Target(value=TYPE) public @interface PersistentClass
Annotation that marks a class as persistent.
The following is an example of a class that uses this annotation.
@PersistentClass(
table="User",
autoIncrement=true,
idField="UserID",
indexes=@PropertyIndex(unique=true,propertyNames={"userName"})
}
public class User {
public String getUserName() {
...
}
public void setUserName(String userName) {
...
}
}
Optional Element Summary | |
---|---|
boolean |
autoIncrement
When set to true , requests the ID field to be auto-increment. |
boolean |
deleteFields
In automatic schema evolution mode, this value indicates whether fields no longer mapped from bean properties should be removed from the underlying table. |
java.lang.String |
idField
Requests a name for the ID field. |
PropertyIndex[] |
indexes
An array of property indexes that will be translated into database indexes. |
java.lang.String |
table
The requested table name. |
boolean |
userManaged
When this value is true, the annotated table will not be automatically created or altered. |
public abstract java.lang.String table
public abstract PropertyIndex[] indexes
public abstract boolean userManaged
public abstract boolean autoIncrement
true
, requests the ID field to be auto-increment. If auto-increment
is not supported, or if this value is false, then random IDs will be
used.
public abstract boolean deleteFields
public abstract java.lang.String idField
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |