001: // THIS SOFTWARE IS PROVIDED BY SOFTARIS PTY.LTD. AND OTHER METABOSS
002: // CONTRIBUTORS ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING,
003: // BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
004: // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SOFTARIS PTY.LTD.
005: // OR OTHER METABOSS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
006: // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
007: // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
008: // OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
009: // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
010: // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
011: // EVEN IF SOFTARIS PTY.LTD. OR OTHER METABOSS CONTRIBUTORS ARE ADVISED OF THE
012: // POSSIBILITY OF SUCH DAMAGE.
013: //
014: // Copyright 2000-2005 © Softaris Pty.Ltd. All Rights Reserved.
015: package com.metaboss.applications.designstudio.userobjects;
016:
017: import com.metaboss.applications.designstudio.BasePropertiesDialog;
018: import com.metaboss.applications.designstudio.BaseUserObject;
019: import com.metaboss.applications.designstudio.propertiesdialogs.RelationalStorageTechnologyPropertiesDialog;
020: import com.metaboss.applications.designstudio.propertiesview.PropertiesTableModel;
021: import com.metaboss.sdlctools.models.metabossmodel.MetaBossModelPackage;
022: import com.metaboss.sdlctools.models.metabossmodel.technologylibrarymodel.RelationalStorageTechnology;
023: import com.metaboss.sdlctools.models.metabossmodel.technologylibrarymodel.RelationalStorageTechnologyClass;
024: import com.metaboss.sdlctools.models.metabossmodel.technologylibrarymodel.TechnologyLibrary;
025:
026: /* Relational Storage Technology User Object */
027:
028: public class RelationalStorageTechnologyUserObject extends
029: StorageTechnologyUserObject {
030: private RelationalStorageTechnology mStorageTechnology = null;
031:
032: public RelationalStorageTechnologyUserObject(
033: RelationalStorageTechnology pStorageTechnology) {
034: super (pStorageTechnology);
035: mStorageTechnology = pStorageTechnology;
036: }
037:
038: public RelationalStorageTechnologyUserObject(
039: RelationalStorageTechnology pStorageTechnology,
040: String pCaption, int pMode) {
041: super (pStorageTechnology, pCaption, pMode);
042: mStorageTechnology = pStorageTechnology;
043: }
044:
045: // create new datatype
046: public static void addNewStorageTechnology(
047: TechnologyLibrary pLibrary) throws Exception {
048: new RelationalStorageTechnologyUserObject(null).addNewObject(
049: getObjectPackage(pLibrary), pLibrary
050: .getStorageTechnologies());
051: }
052:
053: public BaseUserObject createNewObject(MetaBossModelPackage pPackage) {
054: RelationalStorageTechnologyClass lClass = pPackage
055: .getTechnologyLibraryModel()
056: .getRelationalStorageTechnology();
057: return new RelationalStorageTechnologyUserObject(lClass
058: .createRelationalStorageTechnology());
059: }
060:
061: // load object properties into grid control
062: public void loadObjectProperties(PropertiesTableModel pModel)
063: throws Exception {
064: super .loadObjectProperties(pModel);
065: if (pModel == null || mStorageTechnology == null)
066: return;
067:
068: pModel
069: .AddProperty(
070: "Association Primary Key Constraint Name Conversion Type",
071: mStorageTechnology
072: .getAssociationPrimaryKeyConstraintNameConversionType());
073: pModel
074: .AddProperty(
075: "Association Primary Key Constraint Name Prefix",
076: mStorageTechnology
077: .getAssociationPrimaryKeyConstraintNamePrefix());
078: pModel
079: .AddProperty(
080: "Association Primary Key Constraint Name Suffix",
081: mStorageTechnology
082: .getAssociationPrimaryKeyConstraintNameSuffix());
083:
084: pModel.AddProperty(
085: "AssociationRole Column Name Conversion Type",
086: mStorageTechnology
087: .getAssociationRoleColumnNameConversionType());
088: pModel
089: .AddProperty("Association Role Column Name Prefix",
090: mStorageTechnology
091: .getAssociationRoleColumnNamePrefix());
092: pModel
093: .AddProperty("Association Role Column Name Suffix",
094: mStorageTechnology
095: .getAssociationRoleColumnNameSuffix());
096:
097: pModel
098: .AddProperty(
099: "AssociationRole Referential Constraint Name Conversion Type",
100: mStorageTechnology
101: .getAssociationRoleReferentialConstraintNameConversionType());
102: pModel
103: .AddProperty(
104: "AssociationRole Referential Constraint Name Prefix",
105: mStorageTechnology
106: .getAssociationRoleReferentialConstraintNamePrefix());
107: pModel
108: .AddProperty(
109: "AssociationRole Referential Constraint Name Suffix",
110: mStorageTechnology
111: .getAssociationRoleReferentialConstraintNameSuffix());
112:
113: pModel.AddProperty("Association Table Name Conversion Type",
114: mStorageTechnology
115: .getAssociationTableNameConversionType());
116: pModel.AddProperty("Association Table Name Prefix",
117: mStorageTechnology.getAssociationTableNamePrefix());
118: pModel.AddProperty("Association Table Name Suffix",
119: mStorageTechnology.getAssociationTableNameSuffix());
120:
121: pModel.AddProperty("Attribute Column Name Conversion Type",
122: mStorageTechnology
123: .getAttributeColumnNameConversionType());
124: pModel.AddProperty("Attribute Column Name Prefix",
125: mStorageTechnology.getAttributeColumnNamePrefix());
126: pModel.AddProperty("Attribute Column Name Suffix",
127: mStorageTechnology.getAttributeColumnNameSuffix());
128:
129: pModel
130: .AddProperty(
131: "Entity Attribute Ref Constraint Name Conversion Type",
132: mStorageTechnology
133: .getEntityAttributeRefConstraintNameConversionType());
134: pModel.AddProperty(
135: "Entity Attribute Ref Constraint Name Prefix",
136: mStorageTechnology
137: .getEntityAttributeRefConstraintNamePrefix());
138: pModel.AddProperty(
139: "Entity Attribute Ref Constraint Name Suffix",
140: mStorageTechnology
141: .getEntityAttributeRefConstraintNameSuffix());
142:
143: pModel.AddProperty("Entity Instance Id Column Name",
144: mStorageTechnology.getEntityInstanceIdColumnName());
145:
146: pModel
147: .AddProperty(
148: "Entity Natural Primary Key Constraint Name Conversion Type",
149: mStorageTechnology
150: .getEntityNaturalPrimaryKeyConstraintNameConversionType());
151: pModel
152: .AddProperty(
153: "Entity Natural Primary Key Constraint Name Prefix",
154: mStorageTechnology
155: .getEntityNaturalPrimaryKeyConstraintNamePrefix());
156: pModel
157: .AddProperty(
158: "Entity Natural Primary Key Constraint Name Suffix",
159: mStorageTechnology
160: .getEntityNaturalPrimaryKeyConstraintNameSuffix());
161:
162: pModel
163: .AddProperty(
164: "Entity Primary Key Constraint Name Conversion Type",
165: mStorageTechnology
166: .getEntityPrimaryKeyConstraintNameConversionType());
167: pModel.AddProperty("Entity Primary Key Constraint Name Prefix",
168: mStorageTechnology
169: .getEntityPrimaryKeyConstraintNamePrefix());
170: pModel.AddProperty("Entity Primary Key Constraint Name Suffix",
171: mStorageTechnology
172: .getEntityPrimaryKeyConstraintNameSuffix());
173:
174: pModel.AddProperty("Entity State Column Name",
175: mStorageTechnology.getEntityStateColumnName());
176:
177: pModel.AddProperty("Entity Table Name Conversion Type",
178: mStorageTechnology.getEntityTableNameConversionType());
179: pModel.AddProperty("Entity Table Name Prefix",
180: mStorageTechnology.getEntityTableNamePrefix());
181: pModel.AddProperty("Entity Table Name Suffix",
182: mStorageTechnology.getEntityTableNameSuffix());
183:
184: pModel.AddProperty("Entity Version Id Column Name",
185: mStorageTechnology.getEntityVersionIdColumnName());
186:
187: pModel.AddProperty("Max Column Name Length", new Integer(
188: mStorageTechnology.getMaxColumnNameLength()));
189: pModel.AddProperty("Max Constraint Name Length", new Integer(
190: mStorageTechnology.getMaxConstraintNameLength()));
191: pModel.AddProperty("Max Table Name Length", new Integer(
192: mStorageTechnology.getMaxTableNameLength()));
193:
194: pModel.AddProperty("Reference Description Column Name",
195: mStorageTechnology.getReferenceDescriptionColumnName());
196:
197: pModel
198: .AddProperty(
199: "Reference Primary Key Constraint Name Conversion Type",
200: mStorageTechnology
201: .getReferencePrimaryKeyConstraintNameConversionType());
202: pModel.AddProperty(
203: "Reference Primary Key Constraint Name Prefix",
204: mStorageTechnology
205: .getReferencePrimaryKeyConstraintNamePrefix());
206: pModel.AddProperty(
207: "Reference Primary Key Constraint Name Suffix",
208: mStorageTechnology
209: .getReferencePrimaryKeyConstraintNameSuffix());
210:
211: pModel.AddProperty("Reference Table Name Conversion Type",
212: mStorageTechnology
213: .getReferenceTableNameConversionType());
214: pModel.AddProperty("Reference Table Name Prefix",
215: mStorageTechnology.getReferenceTableNamePrefix());
216: pModel.AddProperty("Reference Table Name Suffix",
217: mStorageTechnology.getReferenceTableNameSuffix());
218: pModel.AddProperty("Reference Value Column Name",
219: mStorageTechnology.getReferenceValueColumnName());
220: pModel.AddProperty("Reference Weight Column Name",
221: mStorageTechnology.getReferenceWeightColumnName());
222:
223: pModel
224: .AddProperty(
225: "Reference Weight Constraint Name Conversion Type",
226: mStorageTechnology
227: .getReferenceWeightConstraintNameConversionType());
228: pModel.AddProperty("Reference Weight Constraint Name Prefix",
229: mStorageTechnology
230: .getReferenceWeightConstraintNamePrefix());
231: pModel.AddProperty("Reference Weight Constraint Name Suffix",
232: mStorageTechnology
233: .getReferenceWeightConstraintNameSuffix());
234: }
235:
236: public BasePropertiesDialog getObjectEditor() {
237: return new RelationalStorageTechnologyPropertiesDialog();
238: }
239: }
|