Column and formula elements by R4R Team

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>


Leave a Comment:
Search
Categories
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!