KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * Created on 14.12.2004
3  */

4 package com.tonbeller.jpivot.param;
5
6 import java.util.List JavaDoc;
7
8 import com.tonbeller.jpivot.olap.model.Member;
9 import com.tonbeller.wcf.param.SessionParam;
10
11 /**
12  * creates a SessionParam from a member property
13  * @see com.tonbeller.jpivot.param.SqlAccess
14  * @see com.tonbeller.wcf.param.SessionParam
15  *
16  */

17 public class PropertyParamProvider extends AbstractParamProvider {
18   private String JavaDoc paramName;
19   private String JavaDoc propertyName;
20
21   /**
22    * creates a SessionParam from a member property. The SQL Value will be the
23    * value of the property, the MDX value will be the member.
24    * @see com.tonbeller.jpivot.param.SqlAccess
25    * @see com.tonbeller.wcf.param.SessionParam
26    *
27    * @param paramName name of the parameter
28    * @param propertyName name of the member property whose value will become the SQL value of the parameter
29    * @return
30    */

31
32   public PropertyParamProvider(String JavaDoc paramName, String JavaDoc propertyName) {
33     this.paramName = paramName;
34     this.propertyName = propertyName;
35   }
36
37   protected void addMemberParams(List JavaDoc list, SqlAccess sa, Member member) {
38     SessionParam param = sa.createParameter(member, paramName, propertyName);
39     if (param != null) // !calculated, !all
40
list.add(param);
41   }
42
43 }
Popular Tags