CodesJava

Easy learning with example program codes

JPA column annotation


The Column annotation is used to specify the mapped column for a persistent property or field. If no Column annotation is specified, the default value will be applied.

Example:

@Column(name="DESC", nullable=false, length=512)
public String getDescription() { 
	return description; 
}

Attribute:

Name: The name of the column.
length: The column length.
nullable: Whether the database column is nullable.
Table: The name of the table that contains the column.
Unique: Whether the column is a unique key.
updatable: Whether the column is included in SQL UPDATE statements generated by the persistence provider.
Precision: The precision for a decimal (exact numeric) column.
insertable: Whether the column is included in SQL INSERT statements generated by the persistence provider.
columnDefinition: The SQL fragment that is used when generating the DDL for the column.

Posted in JPA   
Sign Up/ Sign In
Ask a Question


Industrial Training

We offers Placement Oriented Training on Java, Spring, JSF, Hibernate, PHP, AngularJS, Angular 4, PLSQL, Oracle BI Publisher etc. We also provides Online training, please mail us at hr@codesjava.com.

Development

We also provides the Development services for Website Development , Java Development, PHP Development, Android App Development etc. You can contact us on hr@codesjava.com.

Copyright © 2018 CodesJava DMCA.com Protection Status SiteMap Reference: Java Wiki