View Javadoc
1 /* 2 * PROJECT : DAR Runtime and Tools 3 * COPYRIGHT : Copyright (C) 1999-2004 tim.stephenson@enableit.org 4 * LICENSE : GNU LESSER GENERAL PUBLIC LICENSE 5 * Version 2.1, February 1999 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation; either version 2 of the License, or 10 * (at your option) any later version. 11 * 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with this program; if not, write to the Free Software 19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 */ 21 package org.enableit.db.darrt; 22 23 import org.enableit.db.beans.Index; 24 import org.enableit.db.darrt.beans.DiffData; 25 26 /*** 27 * Defines methods required to construct Data Definition Language. 28 * 29 * <p>Implementations deliver the DDL for a specific RDBMS.</p> 30 * @author default 31 */ 32 public interface DDLGenerator { 33 String NO_DEFINITION_AVAILABLE = "/* No definition available */"; 34 35 /*** 36 * Create a table that does not currently exist. 37 * 38 * @param dataObject 39 */ 40 java.util.List getCreate(Object dataObject); 41 42 /*** 43 * Creates DDL for an index. 44 * @param index to create. 45 */ 46 String getCreateIndex(Index index); 47 48 /*** 49 * Returns the DDL to create the modification between the reference 50 * and targets. 51 * 52 * @param diff 53 * @return <code>List</code> of DDL statements (<code>String</code>s) 54 */ 55 java.util.List getModify(DiffData diff); 56 57 /*** 58 * Return the name of this DDLGenerator. 59 */ 60 String getName(); 61 62 /*** 63 * Returns this RDBMS' implementation of substring. 64 */ 65 String getSubstring(String colName, int from, int to); 66 67 /*** 68 * Returns this RDBMS' implementation of formatted date 69 * (including time and datetime). 70 */ 71 String getFormattedDate(String colName, String format); 72 73 /*** 74 * Converts the DBMS specific default string into a generic (Darrt) one. 75 * 76 * @param dbmsDefault 77 * @return RDBMS independent default defintion. 78 */ 79 String getGenericDefault(String dbmsDefault) ; 80 }

This page was automatically generated by Maven