Skip to content

Commit

Permalink
Fix typo and remove dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiasHafner committed Mar 25, 2024
1 parent eeb895f commit a30c760
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public ResultSet executeQuery() throws SQLException {
}
Frame frame = result.getFrame();
throwIfNotRelational( frame );
currentResult = new PolyhenyResultSet( this, frame, properties.toResultSetProperties() );
currentResult = new PolyphenyResultSet( this, frame, properties.toResultSetProperties() );
return currentResult;
}

Expand Down Expand Up @@ -381,7 +381,7 @@ public boolean execute() throws SQLException {
}
Frame frame = result.getFrame();
throwIfNotRelational( frame );
currentResult = new PolyhenyResultSet( this, frame, properties.toResultSetProperties() );
currentResult = new PolyphenyResultSet( this, frame, properties.toResultSetProperties() );
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import org.polypheny.jdbc.meta.PolyphenyResultSetMetadata;
import org.polypheny.jdbc.properties.PolyphenyResultSetProperties;

public class PolyhenyResultSet implements ResultSet {
public class PolyphenyResultSet implements ResultSet {

private boolean isMeta = false;

Expand All @@ -50,7 +50,7 @@ public class PolyhenyResultSet implements ResultSet {
PolyphenyResultSetProperties properties;


public PolyhenyResultSet(
public PolyphenyResultSet(
PolyphenyStatement statement,
Frame frame,
PolyphenyResultSetProperties properties
Expand All @@ -73,7 +73,7 @@ public PolyhenyResultSet(
}


public PolyhenyResultSet( ArrayList<PolyphenyColumnMeta> columnMetas, ArrayList<ArrayList<TypedValue>> rows ) {
public PolyphenyResultSet( ArrayList<PolyphenyColumnMeta> columnMetas, ArrayList<ArrayList<TypedValue>> rows ) {
this.resultScroller = new MetaScroller<>( rows );
this.metadata = new PolyphenyResultSetMetadata( columnMetas );
this.statement = null;
Expand Down
38 changes: 7 additions & 31 deletions src/main/java/org/polypheny/jdbc/PolyphenyStatement.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,49 +66,25 @@ protected int longToInt( long longNumber ) {
return Math.toIntExact( longNumber );
}

/**
* protected void closeCurrentResult() throws SQLException {
* if ( currentResult != null ) {
* currentResult.close();
* }
* currentResult = null;
* currentUpdateCount = NO_UPDATE_COUNT;
* }
**/

/**
* void discardStatement() throws SQLException {
* if (statementId == NO_STATEMENT_ID) {
* return;
* }
*
* statementId = NO_STATEMENT_ID;
* }
**/

/**
* public void closeStatementOnly() throws SQLException {
* this.statementId = NO_STATEMENT_ID;
* this.currentResult = null;
* close();
* }
**/

private void prepareForReexecution() throws SQLException {
if (currentResult != null) {
if ( currentResult != null ) {
currentResult.close();
}
currentUpdateCount = NO_UPDATE_COUNT;
if (statementId != NO_STATEMENT_ID) {
if ( statementId != NO_STATEMENT_ID ) {
getClient().closeStatement( statementId, getTimeout() );
statementId = NO_STATEMENT_ID;
}
}


public void notifyResultClosure() throws SQLException {
this.currentResult = null;
getClient().closeResult( statementId, getTimeout() );
}


@Override
public void close() throws SQLException {
if ( isClosed ) {
Expand Down Expand Up @@ -165,7 +141,7 @@ public ResultSet executeQuery( String statement ) throws SQLException {
}
Frame frame = response.getResult().getFrame();
throwIfNotRelational( frame );
currentResult = new PolyhenyResultSet( this, frame, properties.toResultSetProperties() );
currentResult = new PolyphenyResultSet( this, frame, properties.toResultSetProperties() );
return currentResult;
}
}
Expand Down Expand Up @@ -317,7 +293,7 @@ public boolean execute( String statement ) throws SQLException {
}
Frame frame = response.getResult().getFrame();
throwIfNotRelational( frame );
currentResult = new PolyhenyResultSet( this, frame, properties.toResultSetProperties() );
currentResult = new PolyphenyResultSet( this, frame, properties.toResultSetProperties() );
return true;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import java.util.List;
import java.util.Map;

import org.polypheny.jdbc.PolyhenyResultSet;
import org.polypheny.jdbc.PolyphenyResultSet;
import org.polypheny.jdbc.meta.PolyphenyColumnMeta;
import org.polypheny.jdbc.deserialization.ProtoToJdbcTypeMap;
import org.polypheny.db.protointerface.proto.ProtoPolyType;
Expand Down Expand Up @@ -123,7 +123,7 @@ public ResultSet getResultSet( long index, int count ) throws SQLException {
currentRow.add( TypedValue.fromObject( elements[i], jdbcBaseType ) );
rows.add( currentRow );
}
return new PolyhenyResultSet( columnMetas, rows );
return new PolyphenyResultSet( columnMetas, rows );
}


Expand Down
10 changes: 5 additions & 5 deletions src/main/java/org/polypheny/jdbc/meta/MetaResultSetBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,22 @@
import org.polypheny.db.protointerface.proto.TableType;
import org.polypheny.db.protointerface.proto.Type;
import org.polypheny.db.protointerface.proto.UserDefinedType;
import org.polypheny.jdbc.PolyhenyResultSet;
import org.polypheny.jdbc.PolyphenyResultSet;
import org.polypheny.jdbc.jdbctypes.TypedValue;

public class MetaResultSetBuilder {

private static <T> PolyhenyResultSet buildEmptyResultSet( String entityName, List<MetaResultSetParameter<T>> metaResultSetParameters ) throws SQLException {
private static <T> PolyphenyResultSet buildEmptyResultSet( String entityName, List<MetaResultSetParameter<T>> metaResultSetParameters ) throws SQLException {
ArrayList<PolyphenyColumnMeta> columnMetas = buildMetas( entityName, metaResultSetParameters );
ArrayList<ArrayList<TypedValue>> rows = new ArrayList<>();
return new PolyhenyResultSet( columnMetas, rows );
return new PolyphenyResultSet( columnMetas, rows );
}


private static <T> PolyhenyResultSet buildResultSet( String entityName, List<T> messages, List<MetaResultSetParameter<T>> metaResultSetParameters ) throws SQLException {
private static <T> PolyphenyResultSet buildResultSet( String entityName, List<T> messages, List<MetaResultSetParameter<T>> metaResultSetParameters ) throws SQLException {
ArrayList<PolyphenyColumnMeta> columnMetas = buildMetas( entityName, metaResultSetParameters );
ArrayList<ArrayList<TypedValue>> rows = buildRows( messages, metaResultSetParameters );
return new PolyhenyResultSet( columnMetas, rows );
return new PolyphenyResultSet( columnMetas, rows );
}


Expand Down

0 comments on commit a30c760

Please sign in to comment.