使用Java代码设置Hibernate映射值
我想使用Java代码设置Hibernate配置:使用Java代码设置Hibernate映射值,java,hibernate,Java,Hibernate,我想使用Java代码设置Hibernate配置: <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"> <hibernate-configuration>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.show_sql">true</property>
.........................
<property name="hibernate.hbm2ddl.auto">update</property>
<mapping class="com.web.models.RfidReaderModel"/>
<mapping class="com.web.models.SensorModel"/>
<mapping class="com.web.models.WhiteListModel"/>
<mapping class="com.web.models.BlackListModel"/>
<mapping class="com.web.models.ClientCardModel"/>
<mapping class="com.web.models.SystemUserModel"/>
<mapping class="com.web.models.AuditLogModel"/>
<mapping class="com.web.models.EntranceWFModel"/>
<mapping class="com.web.models.ExitWFModel"/>
<mapping class="com.web.models.RolesPermissions"/>
<mapping class="com.web.models.SystemUserRole"/>
</session-factory>
</hibernate-configuration>
但我还需要设置映射值:
<mapping class="com.web.models.EntranceWFModel"/>
如何使用Java代码设置它们?使用,例如:
configuration.addAnnotatedClass(EntranceWFModel.class);
使用以下选项,例如:
configuration.addAnnotatedClass(EntranceWFModel.class);
相关问题:。相关问题:。