EMMA Coverage Report (generated Thu May 22 12:08:10 CDT 2014)
[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-2013 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        @Override
44        public void setStatelessSession(StatelessSession statelessSession) {
45                this.statelessSession = statelessSession;
46        }
47 
48        @Override
49        public void setSession(Session statefulSession) {
50                this.statefulSession = statefulSession;
51        }
52 
53        public boolean isStatelessSession() {
54                return this.statefulSession==null && this.statelessSession!=null;
55        }
56 
57        protected StatelessSession getStatelessSession() {
58                return statelessSession;
59        }
60 
61        protected Session getStatefulSession() {
62                return statefulSession;
63        }
64}

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