Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/jpa/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Hibernate:以编程方式添加索引_Hibernate_Jpa - Fatal编程技术网

Hibernate:以编程方式添加索引

Hibernate:以编程方式添加索引,hibernate,jpa,Hibernate,Jpa,如何将索引添加到属性的数据库列定义中 伪代码将类似于 //Iterate through the mappings of all persistent classes. if(entityClass instanceOf MyClass) { // get version property of the class // make sure an index is added in the schema for that column } 可能吗?我使用JPA和Hibernate作

如何将索引添加到属性的数据库列定义中

伪代码将类似于

//Iterate through the mappings of all persistent classes.

if(entityClass instanceOf MyClass) {

  // get version property of the class
  // make sure an index is added in the schema for that column
}

可能吗?我使用JPA和Hibernate作为持久性提供者

使用SQL。Hibernate不是改变数据库结构的合适工具。我正在使用Hibernate的模式生成器创建SQL模式。