Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] Execute SQL after table creation.

Hello.

I want to execute some SQL sentences one time after the database is created 
with eclipselink. How can I do that?

I tried with a customizer but is execution when every single sql statment is 
executed instead only one time.

@Override
        public void customize(Session session) throws Exception {
                session.getEventManager().addListener(new 
SessionEventAdapter() {
                        @Override
                        public void postAcquireClientSession(SessionEvent 
event) {
                                UnitOfWork unitOfWork = 
event.getSession().acquireUnitOfWork();
                                importSql(unitOfWork);
                                unitOfWork.commit();
                        }
                });
        }

thanks for the help.


Back to the top