Skip to content

Commit

Permalink
Refactored the JDBC packages for Java 9 compliance.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gray Watson committed Sep 30, 2020
1 parent 9645c62 commit 3fbbe84
Show file tree
Hide file tree
Showing 76 changed files with 169 additions and 83 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import javax.sql.DataSource;

import com.j256.ormlite.db.DatabaseType;
import com.j256.ormlite.db.DatabaseTypeUtils;
import com.j256.ormlite.jdbc.db.DatabaseTypeUtils;
import com.j256.ormlite.logger.Logger;
import com.j256.ormlite.logger.LoggerFactory;
import com.j256.ormlite.misc.IOUtils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import java.util.Properties;

import com.j256.ormlite.db.DatabaseType;
import com.j256.ormlite.db.DatabaseTypeUtils;
import com.j256.ormlite.jdbc.db.DatabaseTypeUtils;
import com.j256.ormlite.logger.Logger;
import com.j256.ormlite.logger.LoggerFactory;
import com.j256.ormlite.misc.IOUtils;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package com.j256.ormlite.db;
package com.j256.ormlite.jdbc.db;

import java.util.ArrayList;
import java.util.List;

import com.j256.ormlite.db.DatabaseType;

/**
* Utility class which helps with managing database specific classes.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package com.j256.ormlite.db;
package com.j256.ormlite.jdbc.db;

import java.util.List;

import com.j256.ormlite.db.BaseDatabaseType;
import com.j256.ormlite.field.FieldType;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.j256.ormlite.db;
package com.j256.ormlite.jdbc.db;

/**
* Derby database type information used to create the tables, etc.. This is for client connections to a remote Derby
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.j256.ormlite.db;
package com.j256.ormlite.jdbc.db;

import java.io.ByteArrayOutputStream;
import java.io.InputStream;
Expand All @@ -9,6 +9,7 @@

import javax.sql.rowset.serial.SerialBlob;

import com.j256.ormlite.db.BaseDatabaseType;
import com.j256.ormlite.field.BaseFieldConverter;
import com.j256.ormlite.field.DataPersister;
import com.j256.ormlite.field.FieldConverter;
Expand Down Expand Up @@ -153,6 +154,11 @@ public void appendInsertNoColumns(StringBuilder sb) {
sb.append("VALUES(DEFAULT)");
}

@Override
protected void appendSerializableType(StringBuilder sb, FieldType fieldType, int fieldWidth) {
super.appendSerializableType(sb, fieldType, fieldWidth);
}

/**
* Conversion from the Object Java field to the BLOB Jdbc type because the varbinary needs a size otherwise.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
package com.j256.ormlite.db;
package com.j256.ormlite.jdbc.db;

import com.j256.ormlite.db.BaseDatabaseType;

/**
* Generic JdbcOdbcBridge database type information used to create the tables, etc..
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package com.j256.ormlite.db;
package com.j256.ormlite.jdbc.db;

import java.util.List;

import com.j256.ormlite.db.BaseDatabaseType;
import com.j256.ormlite.field.FieldType;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package com.j256.ormlite.db;
package com.j256.ormlite.jdbc.db;

import java.util.List;

import com.j256.ormlite.db.BaseDatabaseType;
import com.j256.ormlite.field.FieldType;
import com.j256.ormlite.field.SqlType;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
package com.j256.ormlite.db;
package com.j256.ormlite.jdbc.db;

import com.j256.ormlite.field.FieldType;

/**
* MariaDB database type information used to create the tables, etc.. It is an extension of MySQL.
Expand All @@ -25,4 +27,14 @@ protected String[] getDriverClassNames() {
public String getDatabaseName() {
return DATABASE_NAME;
}

@Override
protected void appendByteArrayType(StringBuilder sb, FieldType fieldType, int fieldWidth) {
super.appendByteArrayType(sb, fieldType, fieldWidth);
}

@Override
protected void appendLongStringType(StringBuilder sb, FieldType fieldType, int fieldWidth) {
super.appendLongStringType(sb, fieldType, fieldWidth);
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package com.j256.ormlite.db;
package com.j256.ormlite.jdbc.db;

import java.util.List;

import com.j256.ormlite.db.BaseDatabaseType;
import com.j256.ormlite.field.FieldType;

/**
Expand Down Expand Up @@ -94,4 +95,14 @@ public boolean isCreateIfNotExistsSupported() {
public boolean isCreateIndexIfNotExistsSupported() {
return false;
}

@Override
protected void appendByteArrayType(StringBuilder sb, FieldType fieldType, int fieldWidth) {
super.appendByteArrayType(sb, fieldType, fieldWidth);
}

@Override
protected void appendLongStringType(StringBuilder sb, FieldType fieldType, int fieldWidth) {
super.appendLongStringType(sb, fieldType, fieldWidth);
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package com.j256.ormlite.db;
package com.j256.ormlite.jdbc.db;

import java.util.List;

import com.j256.ormlite.db.BaseDatabaseType;
import com.j256.ormlite.field.FieldType;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package com.j256.ormlite.db;
package com.j256.ormlite.jdbc.db;

import java.util.List;

import com.j256.ormlite.db.BaseDatabaseType;
import com.j256.ormlite.field.DataPersister;
import com.j256.ormlite.field.DataType;
import com.j256.ormlite.field.FieldConverter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package com.j256.ormlite.db;
package com.j256.ormlite.jdbc.db;

import java.util.List;

import com.j256.ormlite.db.BaseDatabaseType;
import com.j256.ormlite.field.FieldType;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package com.j256.ormlite.db;
package com.j256.ormlite.jdbc.db;

import java.sql.SQLException;
import java.util.List;

import com.j256.ormlite.db.BaseDatabaseType;
import com.j256.ormlite.field.BaseFieldConverter;
import com.j256.ormlite.field.DataPersister;
import com.j256.ormlite.field.FieldConverter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.j256.ormlite.db;
package com.j256.ormlite.jdbc.db;

/**
* Microsoft SQL server database type information connected through the JTDS JDBC driver.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
package com.j256.ormlite.db;
package com.j256.ormlite.jdbc.db;

import com.j256.ormlite.db.BaseSqliteDatabaseType;

/**
* Sqlite database type information used to create the tables, etc..
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
package com.j256.ormlite.logger;
package com.j256.ormlite.jdbc.logger;

import com.j256.ormlite.logger.Log;

/**
* Class which implements our {@link com.j256.ormlite.logger.Log} interface by delegating to Apache Log4j2.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
package com.j256.ormlite.logger;
package com.j256.ormlite.jdbc.logger;

import com.j256.ormlite.logger.Log;

/**
* Class which implements our {@link com.j256.ormlite.logger.Log} interface by delegating to Apache Log4j.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.j256.ormlite.spring;
package com.j256.ormlite.jdbc.spring;

import java.sql.SQLException;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.j256.ormlite.spring;
package com.j256.ormlite.jdbc.spring;

import java.sql.SQLException;
import java.util.HashSet;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.j256.ormlite;
package com.j256.ormlite.jdbc;

import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@

import org.junit.Test;

import com.j256.ormlite.BaseJdbcTest;
import com.j256.ormlite.db.H2DatabaseType;
import com.j256.ormlite.jdbc.db.H2DatabaseType;
import com.j256.ormlite.support.DatabaseConnection;

public class DataSourceConnectionSourceTest extends BaseJdbcTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import org.junit.Test;

import com.j256.ormlite.BaseCoreTest;
import com.j256.ormlite.db.H2DatabaseType;
import com.j256.ormlite.jdbc.db.H2DatabaseType;
import com.j256.ormlite.support.DatabaseConnection;

public class JdbcConnectionSourceTest extends BaseCoreTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import org.junit.Test;

import com.j256.ormlite.BaseJdbcTest;
import com.j256.ormlite.dao.Dao;
import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.field.FieldType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
import com.j256.ormlite.dao.Dao;
import com.j256.ormlite.dao.DaoManager;
import com.j256.ormlite.db.DatabaseType;
import com.j256.ormlite.db.DatabaseTypeUtils;
import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.jdbc.db.DatabaseTypeUtils;
import com.j256.ormlite.misc.IOUtils;
import com.j256.ormlite.support.DatabaseConnection;
import com.j256.ormlite.table.TableUtils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

import org.junit.Test;

import com.j256.ormlite.BaseJdbcTest;
import com.j256.ormlite.dao.Dao;
import com.j256.ormlite.dao.GenericRawResults;
import com.j256.ormlite.dao.RawRowMapper;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.j256.ormlite;
package com.j256.ormlite.jdbc;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.InvocationTargetException;
Expand All @@ -9,6 +9,8 @@
import java.util.ArrayList;
import java.util.List;

import com.j256.ormlite.WrappedConnection;
import com.j256.ormlite.WrappedConnectionSource;
import com.j256.ormlite.jdbc.JdbcConnectionSource;
import com.j256.ormlite.jdbc.JdbcDatabaseConnection;
import com.j256.ormlite.support.DatabaseConnection;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.j256.ormlite.dao;
package com.j256.ormlite.jdbc.dao;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
Expand All @@ -7,8 +7,9 @@
import org.junit.Before;
import org.junit.Test;

import com.j256.ormlite.BaseJdbcTest;
import com.j256.ormlite.dao.Dao;
import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.jdbc.BaseJdbcTest;

public class BulkJdbcDaoTest extends BaseJdbcTest {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.j256.ormlite.dao;
package com.j256.ormlite.jdbc.dao;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
Expand All @@ -10,6 +10,8 @@
import org.junit.Test;

import com.j256.ormlite.BaseCoreTest;
import com.j256.ormlite.dao.Dao;
import com.j256.ormlite.dao.DaoManager;
import com.j256.ormlite.jdbc.JdbcConnectionSource;
import com.j256.ormlite.support.ConnectionSource;
import com.j256.ormlite.table.TableUtils;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.j256.ormlite.dao;
package com.j256.ormlite.jdbc.dao;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
Expand Down Expand Up @@ -31,12 +31,18 @@

import org.junit.Test;

import com.j256.ormlite.BaseJdbcTest;
import com.j256.ormlite.dao.BaseDaoImpl;
import com.j256.ormlite.dao.CloseableIterator;
import com.j256.ormlite.dao.Dao;
import com.j256.ormlite.dao.DaoManager;
import com.j256.ormlite.dao.GenericRawResults;
import com.j256.ormlite.dao.RawRowMapper;
import com.j256.ormlite.dao.Dao.CreateOrUpdateStatus;
import com.j256.ormlite.field.DataType;
import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.field.DatabaseFieldConfig;
import com.j256.ormlite.field.ForeignCollectionField;
import com.j256.ormlite.jdbc.BaseJdbcTest;
import com.j256.ormlite.misc.BaseDaoEnabled;
import com.j256.ormlite.stmt.DeleteBuilder;
import com.j256.ormlite.stmt.PreparedQuery;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.j256.ormlite.db;
package com.j256.ormlite.jdbc.db;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
Expand All @@ -12,11 +12,12 @@

import org.junit.Test;

import com.j256.ormlite.BaseJdbcTest;
import com.j256.ormlite.TestUtils;
import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.field.FieldType;
import com.j256.ormlite.jdbc.BaseJdbcTest;
import com.j256.ormlite.jdbc.JdbcConnectionSource;
import com.j256.ormlite.jdbc.db.DatabaseTypeUtils;
import com.j256.ormlite.stmt.QueryBuilder;
import com.j256.ormlite.support.DatabaseConnection;
import com.j256.ormlite.table.TableInfo;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.j256.ormlite.db;
package com.j256.ormlite.jdbc.db;

import static org.junit.Assert.assertEquals;

Expand All @@ -7,6 +7,8 @@
import org.junit.Test;

import com.j256.ormlite.jdbc.JdbcConnectionSource;
import com.j256.ormlite.jdbc.db.DatabaseTypeUtils;
import com.j256.ormlite.jdbc.db.H2DatabaseType;
import com.j256.ormlite.support.ConnectionSource;

public class DatabaseTypeUtilsTest {
Expand Down
Loading

0 comments on commit 3fbbe84

Please sign in to comment.