Difference between revisions of "EclipseLink/UserGuide/JPA/Basic JPA Development/Mapping/Basic Mappings/Column"

From Eclipsepedia

Jump to: navigation, search
m
m
Line 16: Line 16:
  
  
 +
{{EclipseLink_AttributeTable
 +
|caption=The <tt>@Column</tt> annotation has the following attributes:
 +
|content=
 +
<tr>
 +
<td>'''<tt>name</tt>'''</td>
 +
<td>feh</td>
 +
<td>feh</td>
 +
<td>feh</td>
 +
</tr>
 +
<tr>
 +
<td>'''<tt>unique</tt>'''</td>
 +
<td>feh</td>
 +
<td>feh</td>
 +
<td>feh</td>
 +
</tr>
 +
<tr>
 +
<td>'''<tt>nullable</tt>'''</td>
 +
<td>feh</td>
 +
<td>feh</td>
 +
<td>feh</td>
 +
</tr>
 +
<tr>
 +
<td>'''<tt>insertable</tt>'''</td>
 +
<td>feh</td>
 +
<td>feh</td>
 +
<td>feh</td>
 +
</tr>
 +
<tr>
 +
<td>'''<tt>updatable</tt>'''</td>
 +
<td>feh</td>
 +
<td>feh</td>
 +
<td>feh</td>
 +
</tr>
 +
<tr>
 +
<td>'''<tt>columnDefinition</tt>'''</td>
 +
<td>feh</td>
 +
<td>feh</td>
 +
<td>feh</td>
 +
</tr>
 +
<tr>
 +
<td>'''<tt>table</tt>'''</td>
 +
<td>feh</td>
 +
<td>feh</td>
 +
<td>feh</td>
 +
</tr>
 +
<tr>
 +
<td>'''<tt>length</tt>'''</td>
 +
<td>feh</td>
 +
<td>feh</td>
 +
<td>feh</td>
 +
</tr>
 +
<tr>
 +
<td>'''<tt>precision</tt>'''</td>
 +
<td>feh</td>
 +
<td>feh</td>
 +
<td>feh</td>
 +
</tr>
  
 +
 +
}}
 
''''' Usage of the @Column Annotation'''''
 
''''' Usage of the @Column Annotation'''''
 
<source lang="java">
 
<source lang="java">
@Column
+
@Column(name="ORDER_COST", updatable=false, precision=12, scale=2)
...
+
public BigDecimal getCost() { return cost; }
 
</source>
 
</source>
  

Revision as of 13:43, 14 February 2011


link="http://wiki.eclipse.org/EclipseLink"
EclipseLink
Website
Download
Community
Mailing ListForumsIRC
Bugzilla
Open
Help Wanted
Bug Day
Contribute
Browse Source


THIS PAGE IS IN PROGRESS...

@Column

Use the Column annotation to specify a mapped column for a persistent property or field.

.
Elug javaspec icon.gif

For more information, see Section 11.1.9 "Column Annotation" in the JPA Specification.


The following example shows how to use the @Column annotation to ....


The @Column annotation has the following attributes:
Attribute Description Default Required?
name feh feh feh
unique feh feh feh
nullable feh feh feh
insertable feh feh feh
updatable feh feh feh
columnDefinition feh feh feh
table feh feh feh
length feh feh feh
precision feh feh feh

Usage of the @Column Annotation

@Column(name="ORDER_COST", updatable=false, precision=12, scale=2)
public BigDecimal getCost() { return cost; }

Eclipselink-logo.gif
Version: DRAFT
Other versions...