KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > jaspersoft > jasperserver > api > metadata > jasperreports > domain > impl > datasource > RepoJndiJdbcDataSource


1 /*
2  * Copyright (C) 2006 JasperSoft http://www.jaspersoft.com
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed WITHOUT ANY WARRANTY; and without the
10  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11  * See the GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, see http://www.gnu.org/licenses/gpl.txt
15  * or write to:
16  *
17  * Free Software Foundation, Inc.,
18  * 59 Temple Place - Suite 330,
19  * Boston, MA USA 02111-1307
20  */

21  
22 package com.jaspersoft.jasperserver.api.metadata.jasperreports.domain.impl.datasource;
23
24 import com.jaspersoft.jasperserver.api.metadata.common.domain.Resource;
25 import com.jaspersoft.jasperserver.api.metadata.common.service.ResourceFactory;
26 import com.jaspersoft.jasperserver.api.metadata.common.service.impl.hibernate.ReferenceResolver;
27 import com.jaspersoft.jasperserver.api.metadata.jasperreports.domain.JndiJdbcReportDataSource;
28
29
30
31 /**
32  * @author Lucian Chirita (lucianc@users.sourceforge.net)
33  * @version $Id: DataSourceImpl.java 2281 2006-03-02 18:05:23Z lucian $
34  *
35  * @hibernate.joined-subclass table="JNDIJdbcDatasource"
36  * @hibernate.joined-subclass-key column="id"
37  */

38 public class RepoJndiJdbcDataSource extends RepoReportDataSource
39 {
40     private String JavaDoc jndiName;
41     
42     public RepoJndiJdbcDataSource()
43     {
44     }
45
46     /**
47      * @hibernate.property
48      * column="jndiName" type="string" length="100" not-null="true"
49      */

50     public String JavaDoc getJndiName()
51     {
52         return jndiName;
53     }
54
55     public void setJndiName(String JavaDoc jndiName)
56     {
57         this.jndiName = jndiName;
58     }
59
60
61     protected Class JavaDoc getClientItf() {
62         return JndiJdbcReportDataSource.class;
63     }
64
65     protected void copyTo(Resource clientRes, ResourceFactory resourceFactory) {
66         super.copyTo(clientRes, resourceFactory);
67         
68         JndiJdbcReportDataSource ds = (JndiJdbcReportDataSource) clientRes;
69         ds.setJndiName(getJndiName());
70     }
71     
72     protected void copyFrom(Resource clientRes, ReferenceResolver referenceResolver) {
73         super.copyFrom(clientRes, referenceResolver);
74         JndiJdbcReportDataSource ds = (JndiJdbcReportDataSource) clientRes;
75         setJndiName(ds.getJndiName());
76     }
77 }
78
Popular Tags