001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
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    }