Monday, January 18, 2010

Creating an index on a column using hibernate mapping

Mapping:

 

<property

  name="name"

  column="student_name"

  type="string"

  index="xyz__student_name"/>

 

Table Structure (in PostgreSQL)

 

CREATE TABLE xyz

(

  id bigint NOT NULL,

  student_name character varying(255),

  CONSTRAINT xyz_pkey PRIMARY KEY (id)

)

 

CREATE INDEX xyz__student_name

  ON xyz

  USING btree

  (student_name);

No comments: