1 package org.apache.torque.om;
2
3 /* ====================================================================
4 * The Apache Software License, Version 1.1
5 *
6 * Copyright (c) 2001 The Apache Software Foundation. All rights
7 * reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 *
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 *
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in
18 * the documentation and/or other materials provided with the
19 * distribution.
20 *
21 * 3. The end-user documentation included with the redistribution,
22 * if any, must include the following acknowledgment:
23 * "This product includes software developed by the
24 * Apache Software Foundation (http://www.apache.org/)."
25 * Alternately, this acknowledgment may appear in the software itself,
26 * if and wherever such third-party acknowledgments normally appear.
27 *
28 * 4. The names "Apache" and "Apache Software Foundation" and
29 * "Apache Turbine" must not be used to endorse or promote products
30 * derived from this software without prior written permission. For
31 * written permission, please contact apache@apache.org.
32 *
33 * 5. Products derived from this software may not be called "Apache",
34 * "Apache Turbine", nor may "Apache" appear in their name, without
35 * prior written permission of the Apache Software Foundation.
36 *
37 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
38 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
39 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
40 * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
41 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
42 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
43 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
44 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
45 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
46 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
47 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
48 * SUCH DAMAGE.
49 * ====================================================================
50 *
51 * This software consists of voluntary contributions made by many
52 * individuals on behalf of the Apache Software Foundation. For more
53 * information on the Apache Software Foundation, please see
54 * <http://www.apache.org/>.
55 */
56
57 /***
58 * This empty class marks an ObjectKey as being capable of being
59 * represented as a single column in a database.
60 *
61 * @author <a href="mailto:jmcnally@apache.org">John McNally</a>
62 * @author <a href="mailto:drfish@cox.net">J. Russell Smyth</a>
63 * @version $Id: SimpleKey.java,v 1.5 2003/01/18 14:51:34 mpoeschl Exp $
64 */
65 public abstract class SimpleKey extends ObjectKey
66 {
67 /***
68 * Creates a SimpleKey equivalent to key
69 * @param key the key value
70 * @return a SimpleKey
71 */
72 public static SimpleKey keyFor(java.math.BigDecimal key)
73 {
74 return new NumberKey(key);
75 }
76
77 /***
78 * Creates a SimpleKey equivalent to key
79 * @param key the key value
80 * @return a SimpleKey
81 */
82 public static SimpleKey keyFor(int key)
83 {
84 return new NumberKey(key);
85 }
86
87 /***
88 * Creates a SimpleKey equivalent to key
89 * @param key the key value
90 * @return a SimpleKey
91 */
92 public static SimpleKey keyFor(long key)
93 {
94 return new NumberKey(key);
95 }
96
97 /***
98 * Creates a SimpleKey equivalent to key
99 * @param key the key value
100 * @return a SimpleKey
101 */
102 public static SimpleKey keyFor(double key)
103 {
104 return new NumberKey(key);
105 }
106
107 /***
108 * Creates a SimpleKey equivalent to key
109 * @param key the key value
110 * @return a SimpleKey
111 */
112 public static SimpleKey keyFor(Number key)
113 {
114 return new NumberKey(key);
115 }
116
117 /***
118 * Creates a SimpleKey equivalent to key
119 * @param key the key value
120 * @return a SimpleKey
121 */
122 public static SimpleKey keyFor(NumberKey key)
123 {
124 return new NumberKey(key);
125 }
126
127 /***
128 * Creates a SimpleKey equivalent to key
129 * @param key the key value
130 * @return a SimpleKey
131 */
132 public static SimpleKey keyFor(String key)
133 {
134 return new StringKey(key);
135 }
136
137 /***
138 * Creates a SimpleKey equivalent to key
139 * @param key the key value
140 * @return a SimpleKey
141 */
142 public static SimpleKey keyFor(StringKey key)
143 {
144 return new StringKey(key);
145 }
146
147 /***
148 * Creates a SimpleKey equivalent to key
149 * @param key the key value
150 * @return a SimpleKey
151 */
152 public static SimpleKey keyFor(java.util.Date key)
153 {
154 return new DateKey(key);
155 }
156
157 /***
158 * Creates a SimpleKey equivalent to key
159 * @param key the key value
160 * @return a SimpleKey
161 */
162 public static SimpleKey keyFor(DateKey key)
163 {
164 return new DateKey(key);
165 }
166 }
This page was automatically generated by Maven