View Javadoc

1   /*
2    Wotonomy: OpenStep design patterns for pure Java applications.
3    Copyright (C) 2001 Michael Powers
4   
5    This library is free software; you can redistribute it and/or
6    modify it under the terms of the GNU Lesser General Public
7    License as published by the Free Software Foundation; either
8    version 2.1 of the License, or (at your option) any later version.
9   
10   This library is distributed in the hope that it will be useful,
11   but WITHOUT ANY WARRANTY; without even the implied warranty of
12   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13   Lesser General Public License for more details.
14  
15   You should have received a copy of the GNU Lesser General Public
16   License along with this library; if not, see http://www.gnu.org
17   */
18  package net.wotonomy.jdbcadaptor;
19  
20  import net.wotonomy.access.EOAdaptor;
21  import net.wotonomy.access.EOEntity;
22  import net.wotonomy.access.EOSQLExpression;
23  import net.wotonomy.access.EOSQLExpressionFactory;
24  import net.wotonomy.foundation.NSDictionary;
25  
26  
27  /***
28  * Concrete implementation of EOSQLExpressionFactory for use with JDBC.
29  *
30  * @author ezamudio@nasoft.com
31  * @author $Author: cgruber $
32  * @version $Revision: 903 $
33  */
34  public class JDBCExpressionFactory extends EOSQLExpressionFactory {
35  
36  	protected NSDictionary _jdbcInfo;
37  
38  	/***
39  	 * Creates a new instance.
40  	 * @param adaptor The adaptor for this factory.
41  	 */
42  	public JDBCExpressionFactory(EOAdaptor adaptor) {
43  		super(adaptor);
44  		_jdbcInfo = ((JDBCAdaptor)adaptor()).jdbcInfo();
45  	}
46  
47  	public EOSQLExpression createExpression(EOEntity entity) {
48  		JDBCExpression expr = new JDBCExpression(entity);
49  		expr.setJdbcInfo(_jdbcInfo);
50  		return expr;
51  	}
52  
53  }
54  /*
55   * $Log$
56   * Revision 1.2  2006/02/18 22:59:22  cgruber
57   * make it compile with maven dependencies and add a cvsignore.
58   *
59   * Revision 1.1  2006/02/16 13:22:23  cgruber
60   * Check in all sources in eclipse-friendly maven-enabled packages.
61   *
62   * Revision 1.1  2003/08/13 20:15:05  chochos
63   * the subclass of EOSQLExpressionFactory to be used with JDBC.
64   *
65   */