KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tonbeller > jpivot > param > SqlAccess


1 /*
2  * ====================================================================
3  * This software is subject to the terms of the Common Public License
4  * Agreement, available at the following URL:
5  * http://www.opensource.org/licenses/cpl.html .
6  * Copyright (C) 2003-2004 TONBELLER AG.
7  * All Rights Reserved.
8  * You must accept the terms of that agreement to use this software.
9  * ====================================================================
10  *
11  *
12  */

13 package com.tonbeller.jpivot.param;
14
15 import javax.sql.DataSource JavaDoc;
16
17 import com.tonbeller.jpivot.core.Extension;
18 import com.tonbeller.jpivot.olap.model.Member;
19 import com.tonbeller.wcf.param.SessionParam;
20
21 /**
22  * provides information about members that may
23  * be used in (drill-thru) SQL queries
24  *
25  * @author av
26  */

27 public interface SqlAccess extends Extension {
28   public static final String JavaDoc ID = "sqlAccess";
29
30   /**
31    * returns the data source to access the database
32    */

33   DataSource JavaDoc getDataSource();
34
35   /**
36    * returns a parameter that describes the member.
37    * returns null, if the member does not represent a column
38    * in the database, for example because its the ALL member
39    * or a calculated member.
40    * @paramName the name of the new parameter. If null, the
41    * unique name of the members dimension with ".param" appended is used.
42    */

43   SessionParam createParameter(Member m, String JavaDoc paramName);
44
45   /**
46    * returns a parameter that describes the member.
47    * returns null, if the member does not represent a column
48    * in the database, for example because its the ALL member
49    * or a calculated member.
50    * @param m the member
51    * @param propertyName name of a member property whose value
52    * will be used as sqlValue of the parameter. This may be used
53    * in situations where the members key is for example "John Smith"
54    * and the member property is the customer ID "123" which we want to use
55    * in the SQL queries.
56    * @param paramName teh name of the new paramter
57    */

58   SessionParam createParameter(Member m, String JavaDoc paramName, String JavaDoc propertyName);
59 }
60
Popular Tags