01: // THIS SOFTWARE IS PROVIDED BY SOFTARIS PTY.LTD. AND OTHER METABOSS
02: // CONTRIBUTORS ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING,
03: // BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
04: // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SOFTARIS PTY.LTD.
05: // OR OTHER METABOSS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
06: // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
07: // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
08: // OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
09: // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
10: // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
11: // EVEN IF SOFTARIS PTY.LTD. OR OTHER METABOSS CONTRIBUTORS ARE ADVISED OF THE
12: // POSSIBILITY OF SUCH DAMAGE.
13: //
14: // Copyright 2000-2005 © Softaris Pty.Ltd. All Rights Reserved.
15: package com.metaboss.sdlctools.services.codegeneration.storageimplementationgenerator.relational;
16:
17: import java.util.Properties;
18:
19: import com.metaboss.enterprise.bs.BSException;
20: import com.metaboss.enterprise.datatypes.DataTypeTranslationMetadata;
21: import com.metaboss.sdlctools.models.metabossmodel.datadictionarymodel.DataType;
22:
23: /** Data structure with the particulars of data base */
24: public interface DataBaseMetaData {
25: /** This enumenrated type determines the type of
26: * syntax provided by database for taking a subset of the result set */
27: public static class SubsetSyntaxType {
28: private String mTypeName = null;
29:
30: private SubsetSyntaxType(String pTypeName) {
31: mTypeName = pTypeName;
32: }
33:
34: public boolean equals(Object pOther) {
35: if (pOther == null)
36: return false;
37: if ((pOther instanceof SubsetSyntaxType) == false)
38: return false;
39: return mTypeName
40: .equals(((SubsetSyntaxType) pOther).mTypeName);
41: }
42:
43: /** This is the 'Oracle' style with row count pseudocolumn */
44: public static final SubsetSyntaxType ROWNUM_PSEUDOCOLUMN = new SubsetSyntaxType(
45: "ROWNUM_PSEUDOCOLUMN");
46: /** This is the 'MySQL ' style with LIMIT keyword at the end of the SELECT statement */
47: public static final SubsetSyntaxType LIMIT_KEYWORD = new SubsetSyntaxType(
48: "LIMIT_KEYWORD");
49: }
50:
51: /** The name of the last bit of the package name where storage layer implementation is located */
52: public String getImplementationPackageName();
53:
54: /** Flag indicating if table level comment needs to be generated */
55: public boolean needGenerateTableComments();
56:
57: /** Flag indicating if table column level comments needs to be generated */
58: public boolean needGenerateTableColumnComments();
59:
60: /** Flag indicating if drop constraints needs to be generated */
61: public boolean needGenerateDropConstraints();
62:
63: /** Helper. Suggests the name of the result set get method. For example for java.sql.Date is would return "getDate" */
64: public String suggestResultSetGetMethod(DataType pDataType)
65: throws BSException;
66:
67: /** Helper. Suggests the name of the statement set method. For example for java.sql.Date is would return "setDate" */
68: public String suggestStatementSetMethod(DataType pDataType)
69: throws BSException;
70:
71: /** Helper. Suggests JDBC Metadata Id for java type. For example for java.sql.Date is would return "java.sql.Types.Date" */
72: public String suggestJDBCMetadataId(DataType pDataType)
73: throws BSException;
74:
75: /** Helper. Suggests column type for the java type. For example for java.sql.Date is would return "DATE" */
76: public String suggestColumnDefinition(String pColumnName,
77: DataType pDatatype, boolean pIsMandatory,
78: boolean pIsReference) throws BSException;
79:
80: /** Helper. Suggests column type for the java type. For example for java.sql.Date is would return "DATE" */
81: public String suggestColumnDefinition(String pColumnName,
82: DataTypeTranslationMetadata.SqlType pSqlType,
83: Properties pJDBCJavaTypeProperties, boolean pIsMandatory,
84: boolean pIsReference) throws BSException;
85:
86: /** Helper. Suggests the type of syntax provided by data base for the limiting sthe size of the returned result set */
87: public SubsetSyntaxType suggestSubsetSyntaxType()
88: throws BSException;
89: }
|