JPA如何存储从ADMIN Schema中的某些实体新创建的表?
我在一个项目中犯了一个小错误。我错误地将 JPA 设置为存储来自 USER 模式中的实体的新创建的表。
但现在我想在 ADMIN 模式中创建表,而不是在 USER 中。 我将表放在 USER 处,然后再次选择从实体创建表的选项。第一次询问我有关架构的弹出对话框不再显示。 因此,每次创建表时,它们都会进入 USER 模式。
我应该怎么做才能让 JPA 在 ADMIN 模式中创建表?
在 Eclipse Helios 中哪里可以找到该对话框?
这是我的连接池配置:
这是我的 persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.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_2_0.xsd">
<persistence-unit name="CHAPTER x 12 Container Managed Authentication and Authorization">
<jta-data-source>jdbc/studydb</jta-data-source>
<class>entities.User</class>
<class>entities.Group</class>
</persistence-unit>
</persistence>
I made a little mistake in one of my projects. I wrongly set JPA to store the newly created tables from the entities in the USER schema.
But now i want to create the tables in the ADMIN schema and not in the USER.
I dropped the tables at USER and selected again the option to create the tables from the entities. The pop up dialog that asked me first time about the schema, does not show up again.
So every time the tables are created, they go to the USER schema.
What should i do to make JPA create the tables in the ADMIN schema?
Where do i find that dialog in Eclipse Helios?
This is my connection pool configuration:
And this is my persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.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_2_0.xsd">
<persistence-unit name="CHAPTER x 12 Container Managed Authentication and Authorization">
<jta-data-source>jdbc/studydb</jta-data-source>
<class>entities.User</class>
<class>entities.Group</class>
</persistence-unit>
</persistence>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须单击“其他属性”选项卡。
更新:
您的实体是否具有如下内容:
指定架构。
You have to click the tab "Additional Properties".
Update:
Do your entities have something as follows:
schema specified.