@Test public void test() throws Exception { argument.apply(1, preparedStatement, null); Mockito.verify(preparedStatement).setBytes(Mockito.eq(1), Mockito.isA(byte[].class)); }
@Override public void apply(int position, PreparedStatement statement, StatementContext context) throws SQLException { ByteBuffer buffer = ByteBuffer.wrap(new byte[16]); buffer.putLong(value.getMostSignificantBits()); buffer.putLong(value.getLeastSignificantBits()); statement.setBytes(position, buffer.array()); }
UUIDArgument implements Argument { @Override public void apply(int position, PreparedStatement statement, StatementContext context) throws SQLException { ByteBuffer buffer = ByteBuffer.wrap(new byte[16]); buffer.putLong(value.getMostSignificantBits()); buffer.putLong(value.getLeastSignificantBits()); statement.setBytes(position, buffer.array()); } }
UUIDArgument implements Argument { @Override public void apply(int position, PreparedStatement statement, StatementContext context) throws SQLException { ByteBuffer buffer = ByteBuffer.wrap(new byte[16]); buffer.putLong(value.getMostSignificantBits()); buffer.putLong(value.getLeastSignificantBits()); statement.setBytes(position, buffer.array()); } UUIDArgument(UUID value); }
UUIDArgument implements Argument { @Override public void apply(int position, PreparedStatement statement, StatementContext context) throws SQLException { ByteBuffer buffer = ByteBuffer.wrap(new byte[16]); buffer.putLong(value.getMostSignificantBits()); buffer.putLong(value.getLeastSignificantBits()); statement.setBytes(position, buffer.array()); } UUIDArgument(UUID value); @Override void apply(int position, PreparedStatement statement, StatementContext context); }
UUIDArgument implements Argument { @Override public void apply(int position, PreparedStatement statement, StatementContext context) throws SQLException { ByteBuffer buffer = ByteBuffer.wrap(new byte[16]); buffer.putLong(value.getMostSignificantBits()); buffer.putLong(value.getLeastSignificantBits()); statement.setBytes(position, buffer.array()); } UUIDArgument(UUID value); @Override void apply(int position, PreparedStatement statement, StatementContext context);  }