EMMA Coverage Report (generated Thu Jan 24 13:37:04 CST 2013)
[all classes][org.springframework.batch.item.database.orm]

COVERAGE SUMMARY FOR SOURCE FILE [AbstractHibernateQueryProvider.java]

nameclass, %method, %block, %line, %
AbstractHibernateQueryProvider.java100% (1/1)100% (6/6)100% (27/27)100% (8/8)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class AbstractHibernateQueryProvider100% (1/1)100% (6/6)100% (27/27)100% (8/8)
AbstractHibernateQueryProvider (): void 100% (1/1)100% (3/3)100% (1/1)
getStatefulSession (): Session 100% (1/1)100% (3/3)100% (1/1)
getStatelessSession (): StatelessSession 100% (1/1)100% (3/3)100% (1/1)
isStatelessSession (): boolean 100% (1/1)100% (10/10)100% (1/1)
setSession (Session): void 100% (1/1)100% (4/4)100% (2/2)
setStatelessSession (StatelessSession): void 100% (1/1)100% (4/4)100% (2/2)

1/*
2 * Copyright 2006-2008 the original author or authors.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 
17package org.springframework.batch.item.database.orm;
18 
19import org.hibernate.Query;
20import org.hibernate.Session;
21import org.hibernate.StatelessSession;
22 
23/**
24 * <p>Abstract Hibernate Query Provider to serve as a base class for all 
25 * Hibernate {@link Query} providers.</p>
26 * 
27 * <p>The implementing provider can be configured to use either 
28 * {@link StatelessSession} sufficient for simple mappings without the need 
29 * to cascade to associated objects or standard Hibernate {@link Session} 
30 * for more advanced mappings or when caching is desired.</p>
31 * 
32 * @author Anatoly Polinsky
33 * @author Dave Syer
34 * 
35 * @since 2.1
36 *
37 */
38public abstract class AbstractHibernateQueryProvider implements HibernateQueryProvider {
39    
40    private StatelessSession statelessSession;
41    private Session statefulSession;
42    
43    public void setStatelessSession(StatelessSession statelessSession) {
44                this.statelessSession = statelessSession;
45        }
46 
47        public void setSession(Session statefulSession) {
48                this.statefulSession = statefulSession;
49        }
50 
51        public boolean isStatelessSession() {
52        return this.statefulSession==null && this.statelessSession!=null;
53    }
54 
55        protected StatelessSession getStatelessSession() {
56            return statelessSession;
57        }
58 
59    protected Session getStatefulSession() {
60        return statefulSession;
61    }        
62}

[all classes][org.springframework.batch.item.database.orm]
EMMA 2.0.5312 (C) Vladimir Roubtsov