001: /*
002: * Copyright 2004-2006 the original author or authors.
003: *
004: * Licensed under the Apache License, Version 2.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.apache.org/licenses/LICENSE-2.0
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: */
016:
017: package org.compass.gps.device.jdbc.mapping;
018:
019: /**
020: * A helper base class for mappings from a jdbc column to a Compass
021: * <code>Property</code>. Holds the property name that the column maps to.
022: *
023: * @author kimchy
024: */
025: public abstract class AbstractColumnToPropertyMapping extends
026: AbstractColumnMapping implements ColumnToPropertyMapping {
027:
028: private String propertyName;
029:
030: private boolean excludeFromAll;
031:
032: private String analyzer;
033:
034: private String converter;
035:
036: public AbstractColumnToPropertyMapping() {
037:
038: }
039:
040: public AbstractColumnToPropertyMapping(String columnName,
041: String propertyName) {
042: super (columnName);
043: this .propertyName = propertyName;
044: }
045:
046: public AbstractColumnToPropertyMapping(int columnIndex,
047: String propertyName) {
048: super (columnIndex);
049: this .propertyName = propertyName;
050: }
051:
052: public String getPropertyName() {
053: return propertyName;
054: }
055:
056: public void setPropertyName(String property) {
057: this .propertyName = property;
058: }
059:
060: public boolean isExcludeFromAll() {
061: return excludeFromAll;
062: }
063:
064: public void setExcludeFromAll(boolean excludeFromAll) {
065: this .excludeFromAll = excludeFromAll;
066: }
067:
068: public String getAnalyzer() {
069: return analyzer;
070: }
071:
072: public void setAnalyzer(String analyzer) {
073: this .analyzer = analyzer;
074: }
075:
076: public String getConverter() {
077: return converter;
078: }
079:
080: public void setConverter(String converter) {
081: this .converter = converter;
082: }
083:
084: public String toString() {
085: StringBuffer sb = new StringBuffer();
086: sb.append(super .toString());
087: sb.append(" property [");
088: sb.append(propertyName);
089: sb.append("] store [");
090: sb.append(getPropertyStore());
091: sb.append("] index [");
092: sb.append(getPropertyIndex());
093: sb.append("] termVector [");
094: sb.append(getPropertyTermVector());
095: sb.append("] excludeFromAll [");
096: sb.append(isExcludeFromAll());
097: sb.append("] analyzer [");
098: sb.append(getAnalyzer());
099: sb.append("] converter [");
100: sb.append(getConverter());
101: sb.append("]");
102: return sb.toString();
103: }
104: }
|