-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4064 from stefanuhrig/hana_sql_hint
[GEOT-7230] Implement a HINT parameter as part of the HANA plug-in
- Loading branch information
Showing
5 changed files
with
149 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
.../plugin/jdbc/jdbc-hana/src/test/java/org/geotools/data/hana/HanaSelectHintOnlineTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package org.geotools.data.hana; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
import java.util.Map; | ||
import org.geotools.jdbc.JDBCTestSetup; | ||
import org.geotools.jdbc.JDBCTestSupport; | ||
import org.geotools.jdbc.SQLDialect; | ||
import org.junit.Test; | ||
|
||
public class HanaSelectHintOnlineTest extends JDBCTestSupport { | ||
|
||
@Override | ||
protected JDBCTestSetup createTestSetup() { | ||
return new HanaTestSetupPSPooling(); | ||
} | ||
|
||
@Override | ||
protected Map<String, Object> createDataStoreFactoryParams() throws Exception { | ||
Map<String, Object> params = super.createDataStoreFactoryParams(); | ||
params.put("SELECT Hints", "MYHINT1, MYHINT2"); | ||
return params; | ||
} | ||
|
||
@Test | ||
public void testSelectHint() throws Exception { | ||
SQLDialect dialect = dataStore.getSQLDialect(); | ||
StringBuffer sql = new StringBuffer(); | ||
dialect.handleSelectHints(sql, null, null); | ||
assertEquals(" WITH HINT( MYHINT1, MYHINT2 )", sql.toString()); | ||
} | ||
} |