Ruhezustand-Konfigurationsdatei (.cfg.xml) zum Zuordnen mehrerer MySQL-Tabellen in derselben Datenbank?
Ich experimentiere mit Hibernate für meine Java-Webanwendung. Das Folgende ist Teil meiner Datei hibernate.cfg.xml und ich frage mich, wie ich mehrere Datenbanktabellen in derselben Konfigurationsdatei zuordnen kann. Ich verwende Annotationen, um meine Modelle einer MySQL-Datenbanktabelle zuzuordnen, und ich habe mehrere Modellklassen (zum Beispiel: models.Book). Wie werden die Modelle in hibernate.cfg.xml zugeordnet?
<hibernate-configuration>
<session-factory>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="connection.url">jdbc:mysql://localhost:3306/test_db</property>
<property name="connection.username">root</property>
<property name="connection.password">xxx</property>
<property name="connection.pool_size">1</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="current_session_context_class">thread</property>
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
<property name="show_sql">true</property>
<property name="hbm2ddl.auto">validate</property>
<mapping class ="models.Category" />
</session-factory>
</hibernate-configuration>