public class SnapshotSourceTab extends OracleSourceTab { private static final StringManager s_stringMgr = StringManagerFactory.getStringManager(SnapshotSourceTab.class); /** SQL that retrieves the data. */ private static final String SQL = "SELECT 'CREATE MATERIALIZED VIEW ' || TABLE_NAME || ' AS ', QUERY " + "FROM SYS.ALL_SNAPSHOTS " + "WHERE OWNER = ? AND TABLE_NAME = ? "; public SnapshotSourceTab() { // i18n[oracle.displaySnapshotDetails=Display materialized view details] super(s_stringMgr.getString("oracle.displaySnapshotDetails")); super.sourceType = OracleSourceTab.TABLE_TYPE; } protected PreparedStatement createStatement() throws SQLException { ISession session = getSession(); PreparedStatement pstmt = session.getSQLConnection().prepareStatement(SQL); IDatabaseObjectInfo doi = getDatabaseObjectInfo(); pstmt.setString(1, doi.getSchemaName()); pstmt.setString(2, doi.getSimpleName()); return pstmt
public class ViewSourceTab extends OracleSourceTab { private static final StringManager s_stringMgr = StringManagerFactory.getStringManager(ViewSourceTab.class); /** * This interface defines locale specific strings. */ private interface i18n { // i18n[oracle.diplayScriptDetails=Display script details] String HINT = s_stringMgr.getString("oracle.diplayScriptDetails"); } /** SQL that retrieves the data. */ private static final String SQL = "select 'CREATE OR REPLACE VIEW ' || VIEW_NAME ||' AS ', TEXT " + "FROM SYS.ALL_VIEWS " + "WHERE OWNER = ? AND VIEW_NAME = ? "; public ViewSourceTab() { super(i18n.HINT); } protected PreparedStatement createStatement() throws SQLException { ISession session = getSession(); PreparedStatement pstmt = session.getSQLConnection().prepareStatement(SQL); IDatabaseObjectInfo doi = getDatabaseObjectInfo(); pstmt.setString(1, doi.getSchemaName()); pstmt.setString(2, doi.getSimpleName()); return pstmt
Clone fragments detected by clone detection tool
File path: /sql12/plugins/oracle/src/net/sourceforge/squirrel_sql/plugins/oracle/tab/SnapshotSourceTab.java File path: /sql12/plugins/oracle/src/net/sourceforge/squirrel_sql/plugins/oracle/tab/ViewSourceTab.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public class SnapshotSourceTab extends OracleSourceTab
1
public class ViewSourceTab extends OracleSourceTab
2
{
2
{
3
	private static final StringManager s_stringMgr =
3
	private static final StringManager s_stringMgr =
4
		StringManagerFactory.getStringManager(SnapshotSourceTab.class
4
		StringManagerFactory.getStringManager(ViewSourceTab.class);
5
	/**
6
	 * This interface defines locale specific strings.
7
	 */
8
	private interface i18n
9
	{
10
		// i18n[oracle.diplayScriptDetails=Display script details]
5
);
11
		String HINT = s_stringMgr.getString("oracle.diplayScriptDetails");
12
	}
6
	/** SQL that retrieves the data. */
13
	/** SQL that retrieves the data. */
7
	private static final String SQL =
14
	private static final String SQL =
8
        "SELECT 'CREATE MATERIALIZED VIEW ' || TABLE_NAME || ' AS ', QUERY " +
15
        "select  'CREATE OR REPLACE VIEW ' || VIEW_NAME ||' AS ', TEXT " +
9
        "FROM SYS.ALL_SNAPSHOTS " +
16
        "FROM SYS.ALL_VIEWS " +
10
        "WHERE OWNER = ? AND TABLE_NAME = ? ";
17
        "WHERE OWNER = ? AND VIEW_NAME = ? ";
11
    
18
    
12
	public SnapshotSourceTab()
19
	public ViewSourceTab()
13
	{
20
	{
14
		// i18n[oracle.displaySnapshotDetails=Display materialized view details]
21
		
15
		super(s_stringMgr.getString("oracle.displaySnapshotDetails"));
16
        super.sourceType = OracleSourceTab.TABLE_TYPE;
22
super(i18n.HINT);
17
	}
23
	}
18
	protected PreparedStatement createStatement() throws SQLException
24
	protected PreparedStatement createStatement() throws SQLException
19
	{
25
	{
20
		ISession session = getSession();
26
		ISession session = getSession();
21
		PreparedStatement pstmt = session.getSQLConnection().prepareStatement(SQL);
27
		PreparedStatement pstmt = session.getSQLConnection().prepareStatement(SQL);
22
		IDatabaseObjectInfo doi = getDatabaseObjectInfo();
28
		IDatabaseObjectInfo doi = getDatabaseObjectInfo();
23
		pstmt.setString(1, doi.getSchemaName());
29
		pstmt.setString(1, doi.getSchemaName());
24
		pstmt.setString(2, doi.getSimpleName());
30
		pstmt.setString(2, doi.getSimpleName());
25
		return pstmt
31
		return pstmt
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones location
Number of node comparisons0