Hi, I'm using hibernate with hbm2ddl.auto=update so that it'll automatically generate my oracle tables for me (i've no intention of learning oracle's sql).
So far, so good, until now i'm trying to get it to create an index. As far as i can tell, i've made my annotations correctly:
package data;
import javax.persistence.*;
import org.hibernate.annotations.Index;
@Entity
@Table(name="log_entries")
@org.hibernate.annotations.Table(appliesTo="log_entries",
indexes = { @Index(name="idx", columnNames = {"job", "version", "schedule", "dttmRun", "pid" } ) } )
public class LogEntry {
@Id @GeneratedValue
Long id;
String job;
String version;
String schedule;
String dttmRun;
int pid;
String command;
int duration;
// getters and setters...
}
When i drop the table and restart my app, it creates the table but not the index. Any ideas?