001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.kernel.upgrade.util;
016    
017    import java.sql.PreparedStatement;
018    import java.sql.ResultSet;
019    
020    /**
021     * @author Alexander Chow
022     * @author Brian Wing Shun Chan
023     */
024    public interface UpgradeTable {
025    
026            public void appendColumn(StringBuilder sb, Object value, boolean last)
027                    throws Exception;
028    
029            public void appendColumn(
030                            StringBuilder sb, ResultSet rs, String name, Integer type,
031                            boolean last)
032                    throws Exception;
033    
034            public String getCreateSQL() throws Exception;
035    
036            public String getDeleteSQL() throws Exception;
037    
038            public String[] getIndexesSQL() throws Exception;
039    
040            public String getInsertSQL() throws Exception;
041    
042            public String getSelectSQL() throws Exception;
043    
044            public boolean isAllowUniqueIndexes() throws Exception;
045    
046            public void setAllowUniqueIndexes(boolean allowUniqueIndexes)
047                    throws Exception;
048    
049            public void setColumn(
050                            PreparedStatement ps, int index, Integer type, String value)
051                    throws Exception;
052    
053            public void setCreateSQL(String createSQL) throws Exception;
054    
055            public void setIndexesSQL(String[] indexesSQL) throws Exception;
056    
057            public void updateTable() throws Exception;
058    
059    }