Skip to content

Commit 50fca4c

Browse files
authored
Merge pull request #33 from VedantMahajanOracle/XDK_SODA1_LINUX.X64_240925
240925
2 parents 8816079 + acf1550 commit 50fca4c

File tree

7 files changed

+689
-599
lines changed

7 files changed

+689
-599
lines changed

orajsoda/pom.xml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
<dependency>
4343
<groupId>com.oracle.database.jdbc</groupId>
4444
<artifactId>ojdbc8</artifactId>
45-
<version>23.3.0.23.09</version>
45+
<version>23.5.0.24.07</version>
4646
</dependency>
4747
</dependencies>
4848

@@ -86,7 +86,7 @@
8686
</excludes>
8787
</configuration>
8888
</plugin>
89-
<plugin>
89+
<plugin>
9090
<groupId>org.apache.maven.plugins</groupId>
9191
<artifactId>maven-javadoc-plugin</artifactId>
9292
<version>3.6.3</version>
@@ -96,8 +96,10 @@
9696
<phase>prepare-package</phase>
9797
<goals>
9898
<goal>javadoc</goal>
99+
<goal>jar</goal>
99100
</goals>
100101
<configuration>
102+
<doctitle>Version 1.1.27</doctitle>
101103
<doclint>none</doclint>
102104
<sourcepath>src/main/java</sourcepath>
103105
<overview>src/main/java/oracle/soda/overview.html</overview>
@@ -106,9 +108,18 @@
106108
<version>false</version>
107109
<author>false</author>
108110
<failOnError>false</failOnError>
111+
<overview>src/main/java/oracle/soda/overview.html</overview>
112+
109113
<sourceFileExcludes>
110114
<sourceFileExclude>${excludes}</sourceFileExclude>
111115
</sourceFileExcludes>
116+
117+
<sourceFileIncludes>
118+
<sourceFileInclude>**/oracle/soda/*.java</sourceFileInclude>
119+
<sourceFileInclude>**/oracle/soda/rdbms/OracleRDBMSMetadataBuilder.java</sourceFileInclude>
120+
<sourceFileInclude>**/oracle/soda/rdbms/OracleRDBMSClient.java</sourceFileInclude>
121+
</sourceFileIncludes>
122+
112123
</configuration>
113124
</execution>
114125
</executions>
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>SODA - Simple Oracle Document Access</title>
5+
</head>
6+
<body>
7+
<h1 style="font-size: 1.8em; text-align: center;"><span style="font-weight: bold;">SODA - Simple Oracle Document Access</span></h1>
8+
<p>
9+
SODA is a simple API for working with document collections. The API
10+
is primarily designed for working with JSON documents, although
11+
other types of document content, such as images, audio, and video,
12+
are supported as well.
13+
</p>
14+
<p>
15+
Find, insert, replace, and remove are some of the operations provided on
16+
document collections.
17+
</p>
18+
<p>
19+
The core interfaces are:
20+
</p>
21+
<table border="1" style="width:600px">
22+
<caption>&nbsp;</caption>
23+
<tr>
24+
<th>Interface</th>
25+
<th>Description</th>
26+
</tr>
27+
<tr>
28+
<td>OracleClient</td>
29+
<td>Entry point for working with the API. For the Oracle RDBMS SODA implementation, the entry point is the oracle.soda.rdbms.OracleRDBMSClient class, which implements this interface</td>
30+
</tr>
31+
<tr>
32+
<td>OracleDocument</td>
33+
<td>Document</td>
34+
</tr>
35+
<tr>
36+
<td>OracleDatabase</td>
37+
<td>Database of document collections. Provides methods for opening of collections</td>
38+
</tr>
39+
<tr>
40+
<td>OracleDatabaseAdmin</td>
41+
<td>Provides DDL and metadata methods, such as collection creation, for the OracleDatabase</td>
42+
</tr>
43+
<tr>
44+
<td>OracleCollection</td>
45+
<td>Document collection. Provides find(), insert(), etc. methods</td>
46+
</tr>
47+
<tr>
48+
<td>OracleCollectionAdmin</td>
49+
<td>Provides DDL and metadata methods, such as index creation, for the OracleCollection</td>
50+
</tr>
51+
<tr>
52+
<td>OracleOperationBuilder</td>
53+
<td>A builder and executor of read and write operations on the document collection</td>
54+
</tr>
55+
<tr>
56+
<td>OracleCursor</td>
57+
<td>Returned by OracleOperationBuilder.iterator(). Allows iteration over results of a read operation on the document collection. The next() method returns the next OracleDocument from the result</td>
58+
</tr>
59+
</table>
60+
<p><b>Note: future additions to the SODA interfaces are possible</b></p>
61+
</body>
62+
</html>

orajsoda/src/main/java/oracle/soda/rdbms/impl/OracleOperationBuilderImpl.java

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ public class OracleOperationBuilderImpl implements OracleOperationBuilder {
100100

101101
private int limit;
102102

103+
private int prefetch;
104+
105+
private long rowDataLimit;
106+
103107
private long skip;
104108
private boolean orderByKey = true;
105109
private Long asOfScn = null;
@@ -191,6 +195,10 @@ private enum Terminal
191195
firstRows = -1;
192196

193197
metrics = collection.getMetrics();
198+
199+
prefetch = 0;
200+
201+
rowDataLimit = 0;
194202
}
195203

196204
// If true, this flag requests that the returned cursor
@@ -1846,8 +1854,15 @@ public Void apply(String name, ValueTypePair value) {
18461854
{
18471855
// If it's not a single row operation, set array fetch size
18481856
if (!isSingleKey)
1849-
stmt.setFetchSize(SODAConstants.BATCH_FETCH_SIZE);
1857+
{
1858+
if (prefetch > 0)
1859+
stmt.setFetchSize(Math.min(prefetch, SODAConstants.BATCH_FETCH_SIZE));
1860+
else
1861+
stmt.setFetchSize(SODAConstants.BATCH_FETCH_SIZE);
18501862

1863+
if (rowDataLimit > 0)
1864+
((oracle.jdbc.internal.OracleStatement)stmt).setRowDataLimit(rowDataLimit);
1865+
}
18511866
// Prefetch LOB data with the row(s)
18521867
collection.db.setLobPrefetchSize(stmt);
18531868
}
@@ -2453,6 +2468,30 @@ public OracleOperationBuilder firstRowsHint(int numRows)
24532468
return this;
24542469
}
24552470

2471+
/* Not part of a public API */
2472+
public OracleOperationBuilder prefetch(int prefetch) throws OracleException
2473+
{
2474+
if (prefetch < 0L)
2475+
{
2476+
throw SODAUtils.makeException(SODAMessage.EX_ARG_MUST_BE_NON_NEGATIVE,
2477+
"prefetch");
2478+
}
2479+
this.prefetch = prefetch;
2480+
return this;
2481+
}
2482+
2483+
/* Not part of a public API */
2484+
public OracleOperationBuilder rowDataLimit(long rowDataLimit) throws OracleException
2485+
{
2486+
if (prefetch < 0L)
2487+
{
2488+
throw SODAUtils.makeException(SODAMessage.EX_ARG_MUST_BE_NON_NEGATIVE,
2489+
"rowDataLimit");
2490+
}
2491+
this.rowDataLimit = rowDataLimit;
2492+
return this;
2493+
}
2494+
24562495
/* Not part of a public API */
24572496
// ### It would be better to provide the plan via logging instead.
24582497
// Remove this method once that's done.

0 commit comments

Comments
 (0)