Persistence xml 2 tables

I currently have the following persistence xml file, I am using it to create two databases, one containing a table of users (mapped from a java entity class) and the other to map a table of monsters (as above).I am totally new to JPA, this is the first time I've used it and so far I have managed to cobble the following xml code together:\[code\]<?xml version="1.0" encoding="UTF-8"?><persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"> <persistence-unit name="monsters" transaction-type="RESOURCE_LOCAL"> <class>databaseManagement.Monster</class> <properties> <property name="hibernate.connection.driver_class" value="http://stackoverflow.com/questions/14418137/org.hsqldb.jdbcDriver"/> <property name="hibernate.connection.username" value=""/> <property name="hibernate.connection.password" value=""/> <property name="hibernate.connection.url" value="http://stackoverflow.com/questions/14418137/jdbc:hsqldb:monsters"/> <property name="hibernate.dialect" value="http://stackoverflow.com/questions/14418137/org.hibernate.dialect.HSQLDialect"/> <property name="hibernate.hbm2ddl.auto" value="http://stackoverflow.com/questions/14418137/update"/> </properties> </persistence-unit> <persistence-unit name="users" transaction-type="RESOURCE_LOCAL"> <class>databaseManagement.User</class> <properties> <property name="hibernate.connection.driver_class" value="http://stackoverflow.com/questions/14418137/org.hsqldb.jdbcDriver"/> <property name="hibernate.connection.username" value=""/> <property name="hibernate.connection.password" value=""/> <property name="hibernate.connection.url" value="http://stackoverflow.com/questions/14418137/jdbc:hsqldb:users"/> <property name="hibernate.dialect" value="http://stackoverflow.com/questions/14418137/org.hibernate.dialect.HSQLDialect"/> <property name="hibernate.hbm2ddl.auto" value="http://stackoverflow.com/questions/14418137/update"/> </properties> </persistence-unit></persistence>\[/code\]However, what I want is the user and monster tables to be two tables in a single database rather than two tables in two separate databases as they currently are, however I am not sure how to do this.Thanks a lot, I am really quite stuck as to how this is accomplished, any help is appreciated :)
 
Back
Top