在 jpa/EclipseLink 创建表后执行 sql 脚本? [英] Execute sql script after jpa/EclipseLink created tables?

查看:22
本文介绍了在 jpa/EclipseLink 创建表后执行 sql 脚本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能在 EclipseLink 生成 ddl 后执行 sql 脚本?
换句话说,是否有可能使用带有drop-and-create-tables"的 EclipseLink 属性eclipselink.ddl-generation",并且 EclipseLink 在创建后执行另一个 sql 文件(将一些数据插入刚刚创建的某些表中)表定义?

is there a possibility to execute an sql script, after EclipseLink generated the ddl?
In other words, is it possible that the EclipseLink property "eclipselink.ddl-generation" with "drop-and-create-tables" is used and EclipseLink executes another sql-file (to insert some data into some tables just created) after creating the table definition?

我将 EclipseLink 2.x 和 JPA 2.0 与 GlassFish v3 一起使用.

I'm using EclipseLink 2.x and JPA 2.0 with GlassFish v3.

或者我可以在项目(与 ejb3 的战争)部署中调用的 java 方法中初始化表吗?

Or can I init the tables within a java method which is called on the project (war with ejb3) deployment?

推荐答案

它被称为 BEFORE ddl-execution.而且似乎没有很好的方法来适应它,因为没有合适的事件可以使用.

It is called BEFORE ddl-execution. And there seems to be no nice way to adapt it, as there is no suitable event one could use.

这篇关于在 jpa/EclipseLink 创建表后执行 sql 脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆