KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > ejb > Ejb3Configuration


1 //$Id: Ejb3Configuration.java,v 1.3 2005/07/18 22:37:30 epbernard Exp $
2
package org.hibernate.ejb;
3
4 import java.util.HashMap JavaDoc;
5 import java.util.Map JavaDoc;
6 import javax.sql.DataSource JavaDoc;
7
8 import org.hibernate.HibernateException;
9 import org.hibernate.cfg.AnnotationConfiguration;
10 import org.hibernate.cfg.Settings;
11
12 /**
13  * @author Emmanuel Bernard
14  */

15 public class Ejb3Configuration extends AnnotationConfiguration {
16     public Ejb3Configuration() {
17         super( new InjectionSettingsFactory() );
18     }
19
20     public void setDataSource(DataSource JavaDoc ds) {
21         Map JavaDoc cpInjection = new HashMap JavaDoc();
22         cpInjection.put( "dataSource", ds );
23         ( (InjectionSettingsFactory) settingsFactory).setConnectionProviderInjectionData( cpInjection );
24     }
25
26     public Settings buildSettings() throws HibernateException {
27         return settingsFactory.buildSettings( getProperties() );
28     }
29 }
30
Popular Tags