Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  * Copyright 2008,  Unitils.org
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
  *     http://www.apache.org/licenses/LICENSE-2.0
  *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.unitils.orm.hibernate.annotation;
import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
Annotation that can be used for configuring a hibernate SessionFactory on a test class. Such a SessionFactory will connect to the unitils configured test datasource.

This annotation can be used at class, method or field level. If at field level, the SessionFactory associated with this test object is injected. If put on a method with a single argument of type SessionFactory, the method is invoked with the SessionFactory as argument.

This annotation can also be used to identify a custom configuration method. Such a method takes as single parameter a hibernate org.hibernate.cfg.Configuration object, on which any specified configuration files were already loaded.

Author(s):
Filip Neven
Tim Ducheyne
public @interface HibernateSessionFactory {

    
Specifies zero, one or more configuration files, that will be used to configure the hibernate SessionFactory
    String[] value() default {};
New to GrepCode? Check out our FAQ X