Skip to main content

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

There is currently no table creation event, please log a bug to have this
added (and vote for it).

You could use the postAcquireClientSession event and just keep track of the
first time it is call with a flag in your listener.



Arcangel wrote:
> 
> On Dom 24 Oct 2010 01:14:05 Frank Schwarz escribió:
>> How about this?:
>> 
>> 
>> @Override
>> public void customize(Session session) throws Exception {
>> 	session.getEventManager().addListener(new SessionEventAdapter() {
>> 		@Override
>> 		public void postLogin(SessionEvent event) {
>> 			java.sql.Connection connection =
>> 					
> ((AbstractSession)event.getSession()).getAccessor().getConnection();
>> 		}
>> 	});
>> }
>> 
>> There is however no indication of whether EL just (re-)created the
>> database
>> structure. You have to check that yourself.
> Unfortuntely, this execute the querys just before the tables are created
> and 
> what I need is to execute the querys after de tables are created.
> 
> Any other idea?
>> 
>> 
>> -- Frank
>> 
>> Arcangel wrote:
>> > Hello.
>> > 
>> > I want to execute some SQL sentences one time after the database is
>> > created
>> > with eclipselink. How can I do that?
> 
> 


-----
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland 
http://www.eclipse.org/eclipselink/
 EclipseLink ,  http://www.oracle.com/technology/products/ias/toplink/
TopLink 
Wiki:  http://wiki.eclipse.org/EclipseLink EclipseLink , 
http://wiki.oracle.com/page/TopLink TopLink 
Forums:  http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink , 
http://www.nabble.com/EclipseLink-f26430.html EclipseLink 
Book:  http://en.wikibooks.org/wiki/Java_Persistence Java Persistence 
-- 
View this message in context: http://old.nabble.com/Execute-SQL-after-table-creation.-tp30033121p30067259.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top