-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: index index creation on postgres 8.2.3
PostPosted: Wed Feb 14, 2007 12:45 am 
Newbie

Joined: Wed Feb 14, 2007 12:38 am
Posts: 3
Hi,

I use Hibernate annotation to define a POJO which I would like to create index on a column. Following is my POJO:

@Entity
@Table(name = "ROUTER")
@org.hibernate.annotations.Table(appliesTo="ROUTER", indexes = { @Index(name="router_mac_index", columnNames = { "MAC" } ) } )
public class Router {
@Column(name="MAC", length=18)
public String getMac() {
return mac;
}
}

After the table is created in postgres I noticed that the 'MAC' column of the table is defined as 'UNIQUE' but there is no index being created. Am I using the index annotation correctly?

Here is the DDL

CREATE TABLE router
(
id integer NOT NULL,
state integer,
protocol character varying(16),
mac character varying(18),
firmware_ver character varying(32) NOT NULL,
max_bandwidth integer NOT NULL DEFAULT 0,
model character varying(64),
oplock integer,
CONSTRAINT router_pkey PRIMARY KEY (id),
CONSTRAINT router_mac_key UNIQUE (mac)
)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.