Column and formula elements: In Hibernate we found the mapping element which accept a column attribute will alternatively accept a <column> subelement. It can be with the link wise <formula> is an alternative to the fourmula attribute.
Example:
<column
name="column_name"
length="N"
precision="N"
scale="N"
not-null="true|false"
unique="true|false"
unique-key="multicolumn_unique_key_name"
index="index_name"
sql-type="sql_type_name"
check="SQL expression"
default="SQL expression"
/>
<formula>SQL expression</formula>
column and formula attributes can even be combined within the same property or association mapping to express.
Example, exotic join conditions.
<many-to-one
name="roomAddress"
class="Address"
insert="false"
update="false"
>
<column name="person_id" not-null="true" length="10"/> <formula>'MAILING'</formula> </many-to-one>