Java SpringBoot,hibernate-如何获取实体属性的索引?

Java SpringBoot,hibernate-如何获取实体属性的索引?,java,hibernate,jpa,spring-boot,annotations,Java,Hibernate,Jpa,Spring Boot,Annotations,我创建了一个实体对象,并用@Index注释对其进行了注释。应用程序工作,但数据库中不存在我想要的索引。我尝试了JPA和Hibernate注释,但都没有成功。此类放在Spring boot 1.3.3.RELEASE应用程序中。在Maven依赖项中,我看到了hibernate-core-4.3.11.Final.jar,它映射到了PostgreSQL 9.4.5。我在application.properties文件中为spring.jpa.hibernate.ddl-auto尝试了不同的值,比如c

我创建了一个实体对象,并用@Index注释对其进行了注释。应用程序工作,但数据库中不存在我想要的索引。我尝试了JPA和Hibernate注释,但都没有成功。此类放在Spring boot 1.3.3.RELEASE应用程序中。在Maven依赖项中,我看到了hibernate-core-4.3.11.Final.jar,它映射到了PostgreSQL 9.4.5。我在application.properties文件中为spring.jpa.hibernate.ddl-auto尝试了不同的值,比如create、create-drop、update,甚至我自己从数据库中删除了表

请帮助:如何让应用程序使用注释创建索引

更新

我使用同一配置创建了注释和索引。我不明白有什么不同。我只发现在停止应用程序并在数据库中创建表之后,需要一些时间才能在pgAdmin中看到索引更新。看起来像是缓存更新之类的。我还发现不能为不同的表创建同名索引。仍然无法得到发生的事情

更新

这里是实体类

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Index;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.jsoup.nodes.Element;

@Entity
@Table(indexes = { @Index(name = "job_id_idx", columnList = "job_id")})
public class JobLifeTime {

    @Id
    @GeneratedValue(strategy=GenerationType.AUTO)   
    private Long code;

    @Column(name="job_id", length=24)

    private String targetJobCode;
    @ManyToOne()
    private ScraperTask scraperTask;
    @Column(name="salary_low")
    private Integer salaryMin;
    @Column(name="salary_high")
    private Integer salaryMax;
    @Column(name="scrape_timestamp")
    private Date scrapeTimestamp;
    @Column(name="remove_timestamp")
    private Date removeTimestamp;

    public JobLifeTime(){}

    //getters and setters ...
}

我注意到上面你说的是Application.properties。那只是打字错误吗?该文件应命名为application.properties(注意小写),并且必须将其放置在src/main/resources下,以便Spring自动识别它是右-小写。应用程序查看此文件并从中获取配置。我只是在写的时候想念这里。将编辑一篇文章。也许这有助于你使用JPA2.1吗?我怎么知道JPA的版本?