Select Algorithm

Select Algorithm
  • Select algorithm is able to generate primary key values on the basis of the underlying database provided triggers.
  • This algorithm is able to provide primary key values of the data types like short, int and long.
  • This algorithm is represented by Hibernate software in the form of a short name like “select” and a predefined class name “org.hibernate.id. SelectGenerator”.
  • This algorithm may take input parameters which are related to triggers.
  • This algorithm is supported by almost all the databases which are supporting triggers.

E.g

<?xml version = "1.0" encoding = "utf-8"?>
<!DOCTYPE hibernate-mapping PUBLIC 
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">

<hibernate-mapping>
	<class name="com.ashok.hibernate.sample.model.Employee" table="emp">
		<id name="id" type="int" column="id">
			<generator class="select">
			    --- parameters related to triggers----
			</generator>
		</id>
		<property name="empName" column="emp_name" type="string" />
		<property name="address" column="address" type="string" />
		<property name="salary" column="salary" type="float" />
	</class>
</hibernate-mapping>

Select Algorithm
Scroll to top