01: /*
02: * Copyright 2004-2006 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16:
17: package org.compass.gps.device.jdbc.mapping;
18:
19: import org.compass.core.Property;
20: import org.compass.core.Property.Index;
21: import org.compass.core.Property.Store;
22: import org.compass.core.Property.TermVector;
23:
24: /**
25: * A helper base class which has all the property options as constants and
26: * immutables except for the property name.
27: * <p>
28: * The <code>PropertyIndex</code> is <code>Property.Index.UN_TOKENIZED</code>.
29: * the <code>PropertyStore</code> is <code>Property.Store.YES</code>, the
30: * <code>PropertyTermVector</code> is <code>Property.TermVector.NO</code>
31: * and the <code>Boost</code> is <code>1.0f</code>.
32: *
33: * @author kimchy
34: */
35: public abstract class AbstractConstantColumnToPropertyMapping extends
36: AbstractColumnToPropertyMapping {
37:
38: public AbstractConstantColumnToPropertyMapping() {
39:
40: }
41:
42: public AbstractConstantColumnToPropertyMapping(String columnName,
43: String propertyName) {
44: super (columnName, propertyName);
45: }
46:
47: public AbstractConstantColumnToPropertyMapping(int columnIndex,
48: String propertyName) {
49: super (columnIndex, propertyName);
50: }
51:
52: public Index getPropertyIndex() {
53: return Property.Index.UN_TOKENIZED;
54: }
55:
56: public Store getPropertyStore() {
57: return Property.Store.YES;
58: }
59:
60: public TermVector getPropertyTermVector() {
61: return Property.TermVector.NO;
62: }
63:
64: public float getBoost() {
65: return 1.0f;
66: }
67: }
|