KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > versant > core > jdbc > sql > exp > CollectionParamExp


1
2 /*
3  * Copyright (c) 1998 - 2005 Versant Corporation
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v1.0
6  * which accompanies this distribution, and is available at
7  * http://www.eclipse.org/legal/epl-v10.html
8  *
9  * Contributors:
10  * Versant Corporation - initial API and implementation
11  */

12 package com.versant.core.jdbc.sql.exp;
13
14 import com.versant.core.jdbc.sql.SqlDriver;
15 import com.versant.core.jdbc.metadata.JdbcTypes;
16 import com.versant.core.util.CharBuf;
17
18 /**
19  */

20 public class CollectionParamExp extends ParamExp {
21     public ColumnExp field;
22
23     public CollectionParamExp(ColumnExp field) {
24         this.field = field;
25     }
26
27     public void appendSQLImp(SqlDriver driver, CharBuf s, SqlExp leftSibling) {
28         firstCharIndex = s.size();
29         field.appendSQL(driver, s, null);
30         s.append(" in (");
31         firstCharIndex = s.size();
32         s.append(')');
33     }
34
35     public String JavaDoc toString() {
36         String JavaDoc n = getClass().getName();
37         int i = n.lastIndexOf('.');
38         if (i >= 0) n = n.substring(i + 1);
39         return n + "@" + Integer.toHexString(System.identityHashCode(this))
40             + " " + JdbcTypes.toString(jdbcType);
41     }
42 }
43
Popular Tags