001: /*
002: * Copyright (c) 1998-2008 Caucho Technology -- all rights reserved
003: *
004: * This file is part of Resin(R) Open Source
005: *
006: * Each copy or derived work must preserve the copyright notice and this
007: * notice unmodified.
008: *
009: * Resin Open Source is free software; you can redistribute it and/or modify
010: * it under the terms of the GNU General Public License as published by
011: * the Free Software Foundation; either version 2 of the License, or
012: * (at your option) any later version.
013: *
014: * Resin Open Source is distributed in the hope that it will be useful,
015: * but WITHOUT ANY WARRANTY; without even the implied warranty of
016: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
017: * of NON-INFRINGEMENT. See the GNU General Public License for more
018: * details.
019: *
020: * You should have received a copy of the GNU General Public License
021: * along with Resin Open Source; if not, write to the
022: *
023: * Free Software Foundation, Inc.
024: * 59 Temple Place, Suite 330
025: * Boston, MA 02111-1307 USA
026: *
027: * @author Rodrigo Westrupp
028: */
029:
030: package com.caucho.amber.cfg;
031:
032: /**
033: * Base class for <column> and <join-column> tag in the orm.xml
034: */
035: abstract public class AbstractColumnConfig {
036:
037: // attributes
038: private String _name;
039: private boolean _isUnique;
040: private boolean _isNullable;
041: private boolean _isInsertable;
042: private boolean _isUpdatable;
043: private String _columnDefinition;
044: private String _table;
045:
046: /**
047: * Returns the name.
048: */
049: public String getName() {
050: return _name;
051: }
052:
053: /**
054: * Sets the name.
055: */
056: public void setName(String name) {
057: _name = name;
058: }
059:
060: public boolean getUnique() {
061: return _isUnique;
062: }
063:
064: public boolean getNullable() {
065: return _isNullable;
066: }
067:
068: public boolean getInsertable() {
069: return _isInsertable;
070: }
071:
072: public boolean getUpdatable() {
073: return _isUpdatable;
074: }
075:
076: public void setUnique(boolean isUnique) {
077: _isUnique = isUnique;
078: }
079:
080: public void setNullable(boolean isNullable) {
081: _isNullable = isNullable;
082: }
083:
084: public void setInsertable(boolean isInsertable) {
085: _isInsertable = isInsertable;
086: }
087:
088: public void setUpdatable(boolean isUpdatable) {
089: _isUpdatable = isUpdatable;
090: }
091:
092: /**
093: * Returns the column definition.
094: */
095: public String getColumnDefinition() {
096: return _columnDefinition;
097: }
098:
099: /**
100: * Sets the column definition.
101: */
102: public void setColumnDefinition(String columnDefinition) {
103: _columnDefinition = columnDefinition;
104: }
105:
106: /**
107: * Returns the table.
108: */
109: public String getTable() {
110: return _table;
111: }
112:
113: /**
114: * Sets the table.
115: */
116: public void setTable(String table) {
117: _table = table;
118: }
119: }
|