KickJava   Java API By Example, From Geeks To Geeks.

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


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.domain.ResourceReference;
26 import com.jaspersoft.jasperserver.api.metadata.common.service.ResourceFactory;
27 import com.jaspersoft.jasperserver.api.metadata.common.service.impl.hibernate.ReferenceResolver;
28 import com.jaspersoft.jasperserver.api.metadata.common.service.impl.hibernate.persistent.RepoResource;
29 import com.jaspersoft.jasperserver.api.metadata.jasperreports.domain.ReportDataSource;
30 import com.jaspersoft.jasperserver.api.metadata.jasperreports.domain.impl.datasource.RepoReportDataSource;
31 import com.jaspersoft.jasperserver.api.metadata.olap.domain.MondrianConnection;
32 import com.jaspersoft.jasperserver.api.metadata.olap.domain.MondrianXMLADefinition;
33
34 /**
35  * @author swood
36  *
37  * @hibernate.joined-subclass table="MondrianXMLADefinition"
38  * @hibernate.joined-subclass-key column="id"
39  */

40 public class RepoMondrianXMLADefinition extends RepoResource {
41
42     private RepoMondrianConnection connection = null;
43     private String JavaDoc catalog;
44
45     /**
46      * @hibernate.property column="catalog" type="string" length="100"
47      *
48      * @return Returns the catalog.
49      */

50     public String JavaDoc getCatalog() {
51         return catalog;
52     }
53
54     /**
55      * @param catalog The catalog to set.
56      */

57     public void setCatalog(String JavaDoc catalog) {
58         this.catalog = catalog;
59     }
60
61     /**
62      * @hibernate.many-to-one
63      * column="mondrianConnection"
64      *
65      * @return Returns the connection.
66      */

67     public RepoMondrianConnection getMondrianConnection() {
68         return connection;
69     }
70
71     /**
72      * @param connection The connection to set.
73      */

74     public void setMondrianConnection(RepoMondrianConnection connection) {
75         this.connection = connection;
76     }
77
78     /* (non-Javadoc)
79      * @see com.jaspersoft.jasperserver.api.metadata.common.service.impl.hibernate.persistent.RepoResourceBase#copyTo(com.jaspersoft.jasperserver.api.metadata.common.domain.Resource)
80      */

81     protected void copyTo(Resource clientRes, ResourceFactory resourceFactory) {
82         super.copyTo(clientRes, resourceFactory);
83
84         MondrianXMLADefinition def = (MondrianXMLADefinition) clientRes;
85
86         def.setCatalog(getCatalog());
87         def.setMondrianConnection(getClientReference(getMondrianConnection(), resourceFactory));
88
89     }
90
91     /* (non-Javadoc)
92      * @see com.jaspersoft.jasperserver.api.metadata.common.service.impl.hibernate.persistent.RepoResourceBase#copyFrom(com.jaspersoft.jasperserver.api.metadata.common.domain.Resource)
93      */

94     protected void copyFrom(Resource clientRes, ReferenceResolver referenceResolver) {
95         super.copyFrom(clientRes, referenceResolver);
96         MondrianXMLADefinition def = (MondrianXMLADefinition) clientRes;
97
98         setCatalog(def.getCatalog());
99         ResourceReference ds = def.getMondrianConnection();
100         RepoMondrianConnection repoConn = (RepoMondrianConnection) getReference(ds, RepoMondrianConnection.class, referenceResolver);
101         setMondrianConnection(repoConn);
102     }
103
104     /* (non-Javadoc)
105      * @see com.jaspersoft.jasperserver.api.metadata.common.service.impl.hibernate.persistent.RepoResourceBase#getClientItf()
106      */

107     protected Class JavaDoc getClientItf() {
108         return MondrianXMLADefinition.class;
109     }
110
111 }
112
Popular Tags