Using hibernate annotations, how to identify a property that is not a database field.
This means that an entity class corresponds to a table, but there is one attribute in the entity class that does not correspond to the field in the table
@Transient
Options available
@Transient indicates that the property is not a mapping to a field in a database table, the ORM framework ignores the property.
If a property is not a field mapping for a database table, it must be marked as @transient, otherwise the ORM framework defaults to its annotation as @basic
Example:
Calculates the age property based on birth
@Transient
public int getage () {
Return GetYear (New Date ())-getYear (birth);
}
If the field of a database map is a normal field, you need to add annotations
@Column (name = "PARAMNM", length = 50)
Public String GETPARAMNM ()
{
return THIS.PARAMNM;
}
Table ID words need to be added
@Id
@GeneratedValue
@Column (name = "Id", unique = true, Nullable = false, Precision = $, scale = 0
public Long getId ()
{
return this.id;
}