copyright notice

git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@17299 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
Steve Ebersole 2009-08-13 19:05:34 +00:00
parent 45e6b97d20
commit ad3409e67b
33 changed files with 694 additions and 77 deletions

View File

@ -1,4 +1,24 @@
//$Id$ /*
* Copyright (c) 2009, Red Hat Middleware LLC or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
package org.hibernate.ejb.connection; package org.hibernate.ejb.connection;
import java.util.Properties; import java.util.Properties;
@ -13,18 +33,21 @@ import org.slf4j.LoggerFactory;
import org.slf4j.Logger; import org.slf4j.Logger;
/** /**
* A connection provider that uses an injected <tt>DataSource</tt>. * A specialization of {@link DatasourceConnectionProvider} which uses the {@link DataSource} specified vi
* Setters has to be called before configure() * {@link #setDataSource} rather than locating it from JNDI.
* <p/>
* NOTE : {@link #setDataSource} must be called prior to {@link #configure}.
* <p/>
* TODO : could not find where #setDataSource is actually called. Can't this just be passed in to #configure???
* *
* @author Emmanuel Bernard * @author Emmanuel Bernard
* @see org.hibernate.connection.ConnectionProvider
*/ */
public class InjectedDataSourceConnectionProvider extends DatasourceConnectionProvider { public class InjectedDataSourceConnectionProvider extends DatasourceConnectionProvider {
private final Logger log = LoggerFactory.getLogger( InjectedDataSourceConnectionProvider.class );
private String user; private String user;
private String pass; private String pass;
private final Logger log = LoggerFactory.getLogger( InjectedDataSourceConnectionProvider.class );
public void setDataSource(DataSource ds) { public void setDataSource(DataSource ds) {
super.setDataSource( ds ); super.setDataSource( ds );
} }
@ -33,7 +56,9 @@ public class InjectedDataSourceConnectionProvider extends DatasourceConnectionPr
user = props.getProperty( Environment.USER ); user = props.getProperty( Environment.USER );
pass = props.getProperty( Environment.PASS ); pass = props.getProperty( Environment.PASS );
if ( getDataSource() == null ) throw new HibernateException( "No datasource provided" ); if ( getDataSource() == null ) {
throw new HibernateException( "No datasource provided" );
}
log.info( "Using provided datasource" ); log.info( "Using provided datasource" );
} }

View File

@ -1,8 +1,23 @@
/* /*
* JBoss, the OpenSource EJB server * Copyright (c) 2009, Red Hat Middleware LLC or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
* *
* Distributable under LGPL license. * This copyrighted material is made available to anyone wishing to use, modify,
* See terms of license at gnu.org. * copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/ */
package org.hibernate.ejb.event; package org.hibernate.ejb.event;
@ -11,7 +26,6 @@ import java.lang.reflect.InvocationTargetException;
/** /**
* @author <a href="mailto:kabir.khan@jboss.org">Kabir Khan</a> * @author <a href="mailto:kabir.khan@jboss.org">Kabir Khan</a>
* @version $Revision: 11282 $
*/ */
public class BeanCallback extends Callback { public class BeanCallback extends Callback {
public BeanCallback(Method callbackMethod) { public BeanCallback(Method callbackMethod) {

View File

@ -1,8 +1,23 @@
/* /*
* JBoss, the OpenSource EJB server * Copyright (c) 2009, Red Hat Middleware LLC or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
* *
* Distributable under LGPL license. * This copyrighted material is made available to anyone wishing to use, modify,
* See terms of license at gnu.org. * copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/ */
package org.hibernate.ejb.event; package org.hibernate.ejb.event;
@ -19,7 +34,6 @@ import org.hibernate.util.ReflectHelper;
/** /**
* @author <a href="mailto:kabir.khan@jboss.org">Kabir Khan</a> * @author <a href="mailto:kabir.khan@jboss.org">Kabir Khan</a>
* @version $Revision: 11282 $
*/ */
public abstract class Callback implements Serializable { public abstract class Callback implements Serializable {
transient protected Method callbackMethod; transient protected Method callbackMethod;

View File

@ -1,4 +1,24 @@
//$Id$ /*
* Copyright (c) 2009, Red Hat Middleware LLC or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
package org.hibernate.ejb.event; package org.hibernate.ejb.event;
/** /**

View File

@ -1,9 +1,23 @@
// $Id$
/* /*
* JBoss, the OpenSource EJB server * Copyright (c) 2009, Red Hat Middleware LLC or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
* *
* Distributable under LGPL license. * This copyrighted material is made available to anyone wishing to use, modify,
* See terms of license at gnu.org. * copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/ */
package org.hibernate.ejb.event; package org.hibernate.ejb.event;

View File

@ -1,4 +1,24 @@
//$Id$ /*
* Copyright (c) 2009, Red Hat Middleware LLC or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
package org.hibernate.ejb.event; package org.hibernate.ejb.event;
import org.hibernate.engine.CascadingAction; import org.hibernate.engine.CascadingAction;
@ -8,7 +28,7 @@ import org.hibernate.util.IdentityMap;
/** /**
* In EJB3, it is the create operation that is cascaded to unmanaged * In EJB3, it is the create operation that is cascaded to unmanaged
* ebtities at flush time (instead of the save-update operation in * entities at flush time (instead of the save-update operation in
* Hibernate). * Hibernate).
* *
* @author Gavin King * @author Gavin King

View File

@ -1,4 +1,24 @@
//$Id$ /*
* Copyright (c) 2009, Red Hat Middleware LLC or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
package org.hibernate.ejb.event; package org.hibernate.ejb.event;
import java.io.Serializable; import java.io.Serializable;

View File

@ -1,4 +1,24 @@
//$Id$ /*
* Copyright (c) 2009, Red Hat Middleware LLC or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
package org.hibernate.ejb.event; package org.hibernate.ejb.event;
import org.hibernate.EntityMode; import org.hibernate.EntityMode;

View File

@ -1,4 +1,24 @@
//$Id$ /*
* Copyright (c) 2009, Red Hat Middleware LLC or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
package org.hibernate.ejb.event; package org.hibernate.ejb.event;
import org.hibernate.engine.CascadingAction; import org.hibernate.engine.CascadingAction;

View File

@ -1,11 +1,30 @@
//$Id$ /*
* Copyright (c) 2009, Red Hat Middleware LLC or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
package org.hibernate.ejb.event; package org.hibernate.ejb.event;
import java.io.Serializable; import java.io.Serializable;
import org.hibernate.event.EventSource; import org.hibernate.event.EventSource;
import org.hibernate.event.def.DefaultMergeEventListener; import org.hibernate.event.def.DefaultMergeEventListener;
import org.hibernate.persister.entity.EntityPersister;
/** /**
* Overrides the LifeCycle OnSave call to call the PrePersist operation * Overrides the LifeCycle OnSave call to call the PrePersist operation

View File

@ -1,4 +1,24 @@
//$Id$ /*
* Copyright (c) 2009, Red Hat Middleware LLC or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
package org.hibernate.ejb.event; package org.hibernate.ejb.event;
import java.io.Serializable; import java.io.Serializable;

View File

@ -1,4 +1,24 @@
//$Id$ /*
* Copyright (c) 2009, Red Hat Middleware LLC or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
package org.hibernate.ejb.event; package org.hibernate.ejb.event;
import org.hibernate.engine.CascadingAction; import org.hibernate.engine.CascadingAction;

View File

@ -1,8 +1,23 @@
/* /*
* JBoss, the OpenSource EJB server * Copyright (c) 2009, Red Hat Middleware LLC or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
* *
* Distributable under LGPL license. * This copyrighted material is made available to anyone wishing to use, modify,
* See terms of license at gnu.org. * copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/ */
package org.hibernate.ejb.event; package org.hibernate.ejb.event;
@ -11,7 +26,6 @@ import org.hibernate.event.PostDeleteEventListener;
/** /**
* @author <a href="mailto:kabir.khan@jboss.org">Kabir Khan</a> * @author <a href="mailto:kabir.khan@jboss.org">Kabir Khan</a>
* @version $Revision: 11282 $
*/ */
public class EJB3PostDeleteEventListener implements PostDeleteEventListener, CallbackHandlerConsumer { public class EJB3PostDeleteEventListener implements PostDeleteEventListener, CallbackHandlerConsumer {
EntityCallbackHandler callbackHandler; EntityCallbackHandler callbackHandler;

View File

@ -1,8 +1,23 @@
/* /*
* JBoss, the OpenSource EJB server * Copyright (c) 2009, Red Hat Middleware LLC or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
* *
* Distributable under LGPL license. * This copyrighted material is made available to anyone wishing to use, modify,
* See terms of license at gnu.org. * copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/ */
package org.hibernate.ejb.event; package org.hibernate.ejb.event;
@ -11,7 +26,6 @@ import org.hibernate.event.PostInsertEventListener;
/** /**
* @author <a href="mailto:kabir.khan@jboss.org">Kabir Khan</a> * @author <a href="mailto:kabir.khan@jboss.org">Kabir Khan</a>
* @version $Revision: 11282 $
*/ */
public class EJB3PostInsertEventListener implements PostInsertEventListener, CallbackHandlerConsumer { public class EJB3PostInsertEventListener implements PostInsertEventListener, CallbackHandlerConsumer {
EntityCallbackHandler callbackHandler; EntityCallbackHandler callbackHandler;

View File

@ -1,8 +1,23 @@
/* /*
* JBoss, the OpenSource EJB server * Copyright (c) 2009, Red Hat Middleware LLC or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
* *
* Distributable under LGPL license. * This copyrighted material is made available to anyone wishing to use, modify,
* See terms of license at gnu.org. * copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/ */
package org.hibernate.ejb.event; package org.hibernate.ejb.event;
@ -11,7 +26,6 @@ import org.hibernate.event.PostLoadEventListener;
/** /**
* @author <a href="mailto:kabir.khan@jboss.org">Kabir Khan</a> * @author <a href="mailto:kabir.khan@jboss.org">Kabir Khan</a>
* @version $Revision: 11282 $
*/ */
public class EJB3PostLoadEventListener implements PostLoadEventListener, CallbackHandlerConsumer { public class EJB3PostLoadEventListener implements PostLoadEventListener, CallbackHandlerConsumer {
EntityCallbackHandler callbackHandler; EntityCallbackHandler callbackHandler;

View File

@ -1,9 +1,23 @@
// $Id$
/* /*
* JBoss, the OpenSource EJB server * Copyright (c) 2009, Red Hat Middleware LLC or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
* *
* Distributable under LGPL license. * This copyrighted material is made available to anyone wishing to use, modify,
* See terms of license at gnu.org. * copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/ */
package org.hibernate.ejb.event; package org.hibernate.ejb.event;

View File

@ -1,11 +1,30 @@
//$Id$ /*
* Copyright (c) 2009, Red Hat Middleware LLC or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
package org.hibernate.ejb.event; package org.hibernate.ejb.event;
import java.io.Serializable; import java.io.Serializable;
import org.hibernate.event.EventSource; import org.hibernate.event.EventSource;
import org.hibernate.event.def.DefaultSaveEventListener; import org.hibernate.event.def.DefaultSaveEventListener;
import org.hibernate.persister.entity.EntityPersister;
/** /**
* Overrides the LifeCycle OnSave call to call the PrePersist operation * Overrides the LifeCycle OnSave call to call the PrePersist operation

View File

@ -1,11 +1,30 @@
//$Id$ /*
* Copyright (c) 2009, Red Hat Middleware LLC or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
package org.hibernate.ejb.event; package org.hibernate.ejb.event;
import java.io.Serializable; import java.io.Serializable;
import org.hibernate.event.EventSource; import org.hibernate.event.EventSource;
import org.hibernate.event.def.DefaultSaveOrUpdateEventListener; import org.hibernate.event.def.DefaultSaveOrUpdateEventListener;
import org.hibernate.persister.entity.EntityPersister;
/** /**
* Overrides the LifeCycle OnSave call to call the PrePersist operation * Overrides the LifeCycle OnSave call to call the PrePersist operation

View File

@ -1,9 +1,23 @@
// $Id:$
/* /*
* JBoss, the OpenSource EJB server * Copyright (c) 2009, Red Hat Middleware LLC or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
* *
* Distributable under LGPL license. * This copyrighted material is made available to anyone wishing to use, modify,
* See terms of license at gnu.org. * copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/ */
package org.hibernate.ejb.event; package org.hibernate.ejb.event;

View File

@ -1,8 +1,23 @@
/* /*
* JBoss, the OpenSource EJB server * Copyright (c) 2009, Red Hat Middleware LLC or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
* *
* Distributable under LGPL license. * This copyrighted material is made available to anyone wishing to use, modify,
* See terms of license at gnu.org. * copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/ */
package org.hibernate.ejb.event; package org.hibernate.ejb.event;
@ -16,7 +31,6 @@ import org.hibernate.util.ReflectHelper;
/** /**
* @author <a href="mailto:kabir.khan@jboss.org">Kabir Khan</a> * @author <a href="mailto:kabir.khan@jboss.org">Kabir Khan</a>
* @version $Revision: 11282 $
*/ */
public class ListenerCallback extends Callback { public class ListenerCallback extends Callback {
protected transient Object listener; protected transient Object listener;

View File

@ -1,4 +1,24 @@
//$Id$ /*
* Copyright (c) 2009, Red Hat Middleware LLC or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
package org.hibernate.ejb.instrument; package org.hibernate.ejb.instrument;
import java.lang.instrument.IllegalClassFormatException; import java.lang.instrument.IllegalClassFormatException;
@ -20,9 +40,6 @@ public class InterceptFieldClassFileTransformer implements javax.persistence.spi
private org.hibernate.bytecode.ClassTransformer classTransformer; private org.hibernate.bytecode.ClassTransformer classTransformer;
public InterceptFieldClassFileTransformer(List<String> entities) { public InterceptFieldClassFileTransformer(List<String> entities) {
// classTransformer = Environment.getBytecodeProvider().getEntityClassTransformer(
// null, entities.toArray( new String[ entities.size() ] )
// );
final List<String> copyEntities = new ArrayList<String>( entities.size() ); final List<String> copyEntities = new ArrayList<String>( entities.size() );
copyEntities.addAll( entities ); copyEntities.addAll( entities );
classTransformer = Environment.getBytecodeProvider().getTransformer( classTransformer = Environment.getBytecodeProvider().getTransformer(
@ -48,11 +65,12 @@ public class InterceptFieldClassFileTransformer implements javax.persistence.spi
); );
} }
public byte[] public byte[] transform(
transform( ClassLoader loader,
ClassLoader loader, String className, Class<?> classBeingRedefined, String className,
ProtectionDomain protectionDomain, byte[] classfileBuffer Class<?> classBeingRedefined,
) throws IllegalClassFormatException { ProtectionDomain protectionDomain,
byte[] classfileBuffer ) throws IllegalClassFormatException {
try { try {
return classTransformer.transform( loader, className, classBeingRedefined, return classTransformer.transform( loader, className, classBeingRedefined,
protectionDomain, classfileBuffer ); protectionDomain, classfileBuffer );

View File

@ -1,8 +1,28 @@
/*
* Copyright (c) 2009, Red Hat Middleware LLC or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
package org.hibernate.ejb.metamodel; package org.hibernate.ejb.metamodel;
import java.io.Serializable; import java.io.Serializable;
import javax.persistence.metamodel.BasicType; import javax.persistence.metamodel.BasicType;
import javax.persistence.metamodel.Type;
/** /**
* @author Emmanuel Bernard * @author Emmanuel Bernard

View File

@ -1,9 +1,29 @@
/*
* Copyright (c) 2009, Red Hat Middleware LLC or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
package org.hibernate.ejb.metamodel; package org.hibernate.ejb.metamodel;
import java.util.Iterator; import java.util.Iterator;
import java.io.Serializable; import java.io.Serializable;
import javax.persistence.metamodel.EmbeddableType; import javax.persistence.metamodel.EmbeddableType;
import javax.persistence.metamodel.Type;
import org.hibernate.mapping.Property; import org.hibernate.mapping.Property;

View File

@ -1,3 +1,24 @@
/*
* Copyright (c) 2009, Red Hat Middleware LLC or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
package org.hibernate.ejb.metamodel; package org.hibernate.ejb.metamodel;
import java.util.Set; import java.util.Set;

View File

@ -1,3 +1,24 @@
/*
* Copyright (c) 2009, Red Hat Middleware LLC or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
package org.hibernate.ejb.metamodel; package org.hibernate.ejb.metamodel;
import java.util.Collections; import java.util.Collections;

View File

@ -1,3 +1,24 @@
/*
* Copyright (c) 2009, Red Hat Middleware LLC or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
package org.hibernate.ejb.metamodel; package org.hibernate.ejb.metamodel;
import java.util.Iterator; import java.util.Iterator;

View File

@ -1,3 +1,24 @@
/*
* Copyright (c) 2009, Red Hat Middleware LLC or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
package org.hibernate.ejb.metamodel; package org.hibernate.ejb.metamodel;
import java.util.HashMap; import java.util.HashMap;

View File

@ -1,3 +1,24 @@
/*
* Copyright (c) 2009, Red Hat Middleware LLC or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
package org.hibernate.ejb.metamodel; package org.hibernate.ejb.metamodel;
import java.util.Iterator; import java.util.Iterator;

View File

@ -1,3 +1,24 @@
/*
* Copyright (c) 2009, Red Hat Middleware LLC or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
package org.hibernate.ejb.metamodel; package org.hibernate.ejb.metamodel;
import java.util.Set; import java.util.Set;

View File

@ -1,3 +1,24 @@
/*
* Copyright (c) 2009, Red Hat Middleware LLC or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
package org.hibernate.ejb.metamodel; package org.hibernate.ejb.metamodel;
import java.lang.reflect.Member; import java.lang.reflect.Member;

View File

@ -1,3 +1,24 @@
/*
* Copyright (c) 2009, Red Hat Middleware LLC or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
package org.hibernate.ejb.metamodel; package org.hibernate.ejb.metamodel;
import java.lang.reflect.Member; import java.lang.reflect.Member;

View File

@ -1,4 +1,24 @@
//$Id$ /*
* Copyright (c) 2009, Red Hat Middleware LLC or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
package org.hibernate.ejb.transaction; package org.hibernate.ejb.transaction;
import javax.transaction.SystemException; import javax.transaction.SystemException;
@ -28,8 +48,7 @@ public class JoinableCMTTransaction extends CMTTransaction {
public boolean isTransactionInProgress( public boolean isTransactionInProgress(
JDBCContext jdbcContext, JDBCContext jdbcContext,
TransactionFactory.Context transactionContext TransactionFactory.Context transactionContext) {
) {
try { try {
return status == JoinStatus.JOINED && isTransactionInProgress( return status == JoinStatus.JOINED && isTransactionInProgress(
transactionContext.getFactory().getTransactionManager().getTransaction() transactionContext.getFactory().getTransactionManager().getTransaction()

View File

@ -1,4 +1,24 @@
//$Id$ /*
* Copyright (c) 2009, Red Hat Middleware LLC or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
package org.hibernate.ejb.transaction; package org.hibernate.ejb.transaction;
import org.hibernate.HibernateException; import org.hibernate.HibernateException;
@ -13,16 +33,20 @@ import org.hibernate.transaction.CMTTransactionFactory;
* @author Emmanuel Bernard * @author Emmanuel Bernard
*/ */
public class JoinableCMTTransactionFactory extends CMTTransactionFactory { public class JoinableCMTTransactionFactory extends CMTTransactionFactory {
public Transaction createTransaction(JDBCContext jdbcContext, Context transactionContext) public Transaction createTransaction(
throws HibernateException { JDBCContext jdbcContext,
Context transactionContext) throws HibernateException {
return new JoinableCMTTransaction( jdbcContext, transactionContext ); return new JoinableCMTTransaction( jdbcContext, transactionContext );
} }
@Override @Override
public boolean isTransactionInProgress( public boolean isTransactionInProgress(
JDBCContext jdbcContext, Context transactionContext, Transaction transaction JDBCContext jdbcContext,
) { Context transactionContext,
if ( transaction == null ) return false; //should not happen though Transaction transaction) {
if ( transaction == null ) {
return false; //should not happen though
}
JoinableCMTTransaction joinableCMTTransaction = ( (JoinableCMTTransaction) transaction ); JoinableCMTTransaction joinableCMTTransaction = ( (JoinableCMTTransaction) transaction );
joinableCMTTransaction.tryJoiningTransaction(); joinableCMTTransaction.tryJoiningTransaction();
return joinableCMTTransaction.isTransactionInProgress( jdbcContext, transactionContext ); return joinableCMTTransaction.isTransactionInProgress( jdbcContext, transactionContext );