EMMA Coverage Report (generated Tue Feb 12 22:23:49 ICT 2008)
[all classes][net.sourceforge.hivetranse.transaction.hibernate3]

COVERAGE SUMMARY FOR SOURCE FILE [SessionFactoryContribution.java]

nameclass, %method, %block, %line, %
SessionFactoryContribution.java100% (1/1)58%  (7/12)48%  (32/66)48%  (10/21)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class SessionFactoryContribution100% (1/1)58%  (7/12)48%  (32/66)48%  (10/21)
addProperty (NameValuePair): void 0%   (0/1)0%   (0/9)0%   (0/2)
setInterceptor (Interceptor): void 0%   (0/1)0%   (0/4)0%   (0/2)
setNamingStrategy (NamingStrategy): void 0%   (0/1)0%   (0/4)0%   (0/2)
setSettings (List): void 0%   (0/1)0%   (0/4)0%   (0/2)
toString (): String 0%   (0/1)0%   (0/13)0%   (0/3)
SessionFactoryContribution (): void 100% (1/1)100% (13/13)100% (3/3)
getConfig (): Resource 100% (1/1)100% (3/3)100% (1/1)
getInterceptor (): Interceptor 100% (1/1)100% (3/3)100% (1/1)
getNamingStrategy (): NamingStrategy 100% (1/1)100% (3/3)100% (1/1)
getProperties (): Properties 100% (1/1)100% (3/3)100% (1/1)
getSettings (): List 100% (1/1)100% (3/3)100% (1/1)
setConfig (Resource): void 100% (1/1)100% (4/4)100% (2/2)

1//  Copyright 2004-2007 Jean-Francois Poilpret
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14 
15package net.sourceforge.hivetranse.transaction.hibernate3;
16 
17import java.util.ArrayList;
18import java.util.List;
19import java.util.Properties;
20 
21import org.apache.hivemind.Resource;
22import org.apache.hivemind.impl.BaseLocatable;
23import org.apache.hivemind.util.ToStringBuilder;
24import org.hibernate.Interceptor;
25import org.hibernate.cfg.NamingStrategy;
26 
27import net.sourceforge.hiveutils.collections.NameValuePair;
28 
29/**
30 * Represents a configuration parameter to the <code>SessionProxyFactory</code>
31 * configured for building a <code>Session</code> service.
32 * Each instance defines a Hibernate configuration file.
33 * Optionally, the instance can embed additional properties to be set
34 * individually before Hibernate <code>SessionFactory</code> is built.
35 *
36 * @author Jean-Francois Poilpret
37 */
38public class SessionFactoryContribution extends BaseLocatable
39{
40        public void                setConfig(Resource config)
41        {
42                _config = config;
43        }
44        public Resource        getConfig()
45        {
46                return _config;
47        }
48        
49        public void                setSettings(List settings)
50        {
51                _settings = settings;
52        }
53        public List                getSettings()
54        {
55                return _settings;
56        }
57        
58        public void                        setInterceptor(Interceptor interceptor)
59        {
60                _interceptor = interceptor;
61        }
62        public Interceptor         getInterceptor()
63        {
64                return _interceptor;
65        }
66        
67        public void                                setNamingStrategy(NamingStrategy namingStrategy)
68        {
69                _namingStrategy = namingStrategy;
70        }
71        public NamingStrategy        getNamingStrategy()
72        {
73                return _namingStrategy;
74        }
75        
76        public void        addProperty(NameValuePair property)
77        {
78                _properties.setProperty(property.getName(), property.getValue());
79        }
80 
81        public Properties        getProperties()
82        {
83                return _properties;
84        }
85 
86    public String toString()
87    {
88        ToStringBuilder builder = new ToStringBuilder(this);
89        builder.append("config", _config);
90        return builder.toString();
91    }
92    
93    private Resource                _config;
94    private List                        _settings = new ArrayList();
95    private Properties                _properties = new Properties();
96    private Interceptor                _interceptor;
97    private NamingStrategy        _namingStrategy;
98}

[all classes][net.sourceforge.hivetranse.transaction.hibernate3]
EMMA 2.0.5312 (C) Vladimir Roubtsov