Index « Annotation « JPA Q&A





1. Creating Indexes on DB with Hibernate @Index Annotation    stackoverflow.com

I have annotation-driven hibernate capabilies on my project. Now I want to create an index over a column. My current column definition is

@NotNull
@Column(name = "hash")
private String hash;
and I add @Index annotation here.
@NotNull
@Column(name ...

2. Hibernate: how to specify clustered index annotation    stackoverflow.com

I want to create an annotated class similar to that:

@Entity
@MappedSuperclass
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
public class SeriesMonitoringPointsTable {
    @Id
    @Column(name = ID, nullable = false)
    ...

3. How do I create an index on join tables using Hibernate annotations?    stackoverflow.com

I have a relationship as follows using Hibernate annotations, this is what I tried:

public class Job{

...

@OneToMany(cascade = CascadeType.ALL)
@JoinTable(name = "jobs_resource_locations")
@ForeignKey(name = "job_inputs_fk")
@Index(name="job_inputs_fk")
private List<FileSystemLocation> inputs;
This sort of thing works nicely on ManyToOne ...

4. Cant create index whith annotations    forum.hibernate.org

5. How to specify clustered index annotation?    forum.hibernate.org

@Entity @MappedSuperclass @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) public class SeriesMonitoringPointsTable { @Id @Column(name = ID, nullable = false) private Long id; public void setId( Long id ) { this.id = id; } }