Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/eclipse/8.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
Java Eclipse和Hibernate—在Hibernate.cfg.xml中添加映射项的更快更简单的方法_Java_Eclipse_Hibernate - Fatal编程技术网

Java Eclipse和Hibernate—在Hibernate.cfg.xml中添加映射项的更快更简单的方法

Java Eclipse和Hibernate—在Hibernate.cfg.xml中添加映射项的更快更简单的方法,java,eclipse,hibernate,Java,Eclipse,Hibernate,我最近在向hibernate.cfg.xml文件添加映射项时遇到问题。需要明确的是,对于我来说,如何生成mapping anotations和所有这些都不是一个谜,但是将这些类添加到hibernate.cfg.xml文件的过程太长了。例如,“Hibernate配置3.0 XML编辑器”有一个bult-in函数,用于在“会话工厂”选项卡中添加映射项。遗憾的是,您可以一次添加一个类,这意味着返回“会话工厂”选项卡,点击映射部分的“添加”按钮,然后从列表中选择另一个类 前 org.postgresq

我最近在向hibernate.cfg.xml文件添加映射项时遇到问题。需要明确的是,对于我来说,如何生成mapping anotations和所有这些都不是一个谜,但是将这些类添加到hibernate.cfg.xml文件的过程太长了。例如,“Hibernate配置3.0 XML编辑器”有一个bult-in函数,用于在“会话工厂”选项卡中添加映射项。遗憾的是,您可以一次添加一个类,这意味着返回“会话工厂”选项卡,点击映射部分的“添加”按钮,然后从列表中选择另一个类


org.postgresql.Driver
***********从
hibernate.archive.autodetection
可以做到这一点吗?
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
                                         "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
 <session-factory name="">
  <property name="hibernate.connection.driver_class">org.postgresql.Driver</property>
  <property name="hibernate.connection.password">***********</property>   <-don't mind this
  <property name="hibernate.connection.url">jdbc:postgresql://localhost:5432/dvdrental</property>
  <property name="hibernate.connection.username">postgres</property>
  <mapping class="Model.Actor"/>  <- here's the problem. Can you generate this automatically?
 </session-factory>
</hibernate-configuration