-->
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.  [ 3 posts ] 
Author Message
 Post subject: Cant create index whith annotations
PostPosted: Tue Mar 02, 2010 10:46 am 
Newbie

Joined: Tue Mar 02, 2010 9:22 am
Posts: 3
Hi, i'm trying to create an index on two colums on a very simple annotated class:

@Entity
@Table(appliesTo="Extension_static_table", indexes = { @Index(name="filename_comment", columnNames={"commented", "filename"} ) } )
public class Extension_static_table {

private long id;
private long cat_metric;
private long var_metric;
private int commented;
private String filename;
private String category;
private String var_name;
private String var_val;

@Id
@GeneratedValue
public long getId() {return id;}
public void setId(long id) {this.id = id;}

public long getCat_metric() {return cat_metric;}
public void setCat_metric(long catMetric) {cat_metric = catMetric;}

public long getVar_metric() {return var_metric;}
public void setVar_metric(long varMetric) {var_metric = varMetric;}

public int getCommented() {return commented;}
public void setCommented(int commented) {this.commented = commented;}

public String getFilename() {return filename;}
public void setFilename(String filename) {this.filename = filename;}

public String getCategory() {return category;}
public void setCategory(String category) {this.category = category;}

public String getVar_name() {return var_name;}
public void setVar_name(String varName) {var_name = varName;}

public String getVar_val() {return var_val;}
public void setVar_val(String varVal) {var_val = varVal;}

}

what am i doing bad (only primary key is created)
Thanks


Top
 Profile  
 
 Post subject: Re: Cant create index whith annotations
PostPosted: Tue Mar 02, 2010 10:55 am 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
I should work indeed.
How do you create the schema?
With hibernate tools?


Top
 Profile  
 
 Post subject: Re: Cant create index whith annotations
PostPosted: Tue Mar 02, 2010 12:15 pm 
Newbie

Joined: Tue Mar 02, 2010 9:22 am
Posts: 3
HI!

yep, setting <property name="hbm2ddl.auto">update</property>
and the table manually dropped in every test


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

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.