01: /*
02: * Copyright (c) 1998 - 2005 Versant Corporation
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * Versant Corporation - initial API and implementation
10: */
11: package com.versant.core.jdbc.sql.exp;
12:
13: import com.versant.core.jdbc.sql.SqlDriver;
14: import com.versant.core.jdbc.metadata.JdbcTypes;
15: import com.versant.core.util.CharBuf;
16:
17: /**
18: */
19: public class CollectionParamExp extends ParamExp {
20: public ColumnExp field;
21:
22: public CollectionParamExp(ColumnExp field) {
23: this .field = field;
24: }
25:
26: public void appendSQLImp(SqlDriver driver, CharBuf s,
27: 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 toString() {
36: String n = getClass().getName();
37: int i = n.lastIndexOf('.');
38: if (i >= 0)
39: n = n.substring(i + 1);
40: return n + "@"
41: + Integer.toHexString(System.identityHashCode(this ))
42: + " " + JdbcTypes.toString(jdbcType);
43: }
44: }
|