KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > jaspersoft > jasperserver > api > metadata > olap > domain > impl > hibernate > RepoXMLAConnection


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.olap.domain.impl.hibernate;
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.common.service.impl.hibernate.persistent.RepoResource;
28 import com.jaspersoft.jasperserver.api.metadata.olap.domain.XMLAConnection;
29
30 /**
31  * @author swood
32  *
33  * @hibernate.joined-subclass table="XMLAConnection"
34  * @hibernate.joined-subclass-key column="id"
35  *
36  */

37 public class RepoXMLAConnection extends RepoOlapClientConnection {
38     
39     private String JavaDoc uri;
40     private String JavaDoc dataSource;
41     private String JavaDoc catalog;
42     private String JavaDoc username;
43     private String JavaDoc password;
44
45     public RepoXMLAConnection() {
46         super();
47     }
48
49     /**
50      * @hibernate.property column="catalog" type="string" length="100"
51      *
52      * @return Returns the catalog.
53      */

54     public String JavaDoc getCatalog() {
55         return catalog;
56     }
57
58     /**
59      * @param catalog The catalog to set.
60      */

61     public void setCatalog(String JavaDoc catalog) {
62         this.catalog = catalog;
63     }
64
65     /**
66      * @hibernate.property column="username" type="string" length="100"
67      *
68      * @return Returns the username.
69      */

70     public String JavaDoc getUsername() {
71         return username;
72     }
73
74     /**
75      * @param username The username to set.
76      */

77     public void setUsername(String JavaDoc username) {
78         this.username = username;
79     }
80
81     /**
82      * @hibernate.property column="password" type="string" length="100"
83      *
84      * @return Returns the password.
85      */

86     public String JavaDoc getPassword() {
87         return password;
88     }
89
90     /**
91      * @param password The password to set.
92      */

93     public void setPassword(String JavaDoc password) {
94         this.password = password;
95     }
96
97     /**
98      * @hibernate.property column="datasource" type="string" length="100"
99      *
100      * @return Returns the dataSource.
101      */

102     public String JavaDoc getDataSource() {
103         return dataSource;
104     }
105
106     /**
107      * @param dataSource The dataSource to set.
108      */

109     public void setDataSource(String JavaDoc dataSource) {
110         this.dataSource = dataSource;
111     }
112
113     /**
114      * @hibernate.property column="uri" type="string" length="100"
115      *
116      * @return Returns the uri.
117      */

118     public String JavaDoc getURI() {
119         return uri;
120     }
121
122     /**
123      * @param uri The uri to set.
124      */

125     public void setURI(String JavaDoc uri) {
126         this.uri = uri;
127     }
128
129     /* (non-Javadoc)
130      * @see com.jaspersoft.jasperserver.api.metadata.common.service.impl.hibernate.persistent.RepoResource#copyTo(com.jaspersoft.jasperserver.api.metadata.common.domain.Resource, com.jaspersoft.jasperserver.api.metadata.common.service.ResourceFactory)
131      */

132     protected void copyTo(Resource clientRes, ResourceFactory resourceFactory) {
133         super.copyTo(clientRes, resourceFactory);
134         
135         XMLAConnection conn = (XMLAConnection) clientRes;
136         
137         conn.setCatalog(getCatalog());
138         conn.setUsername(getUsername());
139         conn.setPassword(getPassword());
140         conn.setDataSource(getDataSource());
141         conn.setURI(getURI());
142     }
143
144     /* (non-Javadoc)
145      * @see com.jaspersoft.jasperserver.api.metadata.common.service.impl.hibernate.persistent.RepoResource#copyFrom(com.jaspersoft.jasperserver.api.metadata.common.domain.Resource, com.jaspersoft.jasperserver.api.metadata.common.service.impl.hibernate.ReferenceResolver)
146      */

147     protected void copyFrom(Resource clientRes, ReferenceResolver referenceResolver) {
148         super.copyFrom(clientRes, referenceResolver);
149         
150         XMLAConnection conn = (XMLAConnection) clientRes;
151         setCatalog(conn.getCatalog());
152         setUsername(conn.getUsername());
153         setPassword(conn.getPassword());
154         setDataSource(conn.getDataSource());
155         setURI(conn.getURI());
156     }
157
158     /* (non-Javadoc)
159      * @see com.jaspersoft.jasperserver.api.metadata.common.service.impl.hibernate.persistent.RepoResourceBase#getClientItf()
160      */

161     protected Class JavaDoc getClientItf() {
162         return XMLAConnection.class;
163     }
164
165 }
166
Popular Tags