mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
More small fixes (#977)
* no effecitve code change: add @FunctionalInterface to designated interfaces * no effective code change: removed obsolete imports * no effective code change: removed obsolete @SuppressWarnings * no effective code change: add @SuppressWarnings to UUID_PLACEHOLDER
This commit is contained in:
committed by
Rob Bygrave
parent
35f3f53443
commit
a315c7c11e
@@ -3,6 +3,7 @@ package io.ebean.config;
|
||||
/**
|
||||
* Provides the Tenant Id for the current request based on the current user.
|
||||
*/
|
||||
@FunctionalInterface
|
||||
public interface CurrentTenantProvider {
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,6 +3,7 @@ package io.ebean.config;
|
||||
/**
|
||||
* Provides the current user in order to support 'Who created', 'Who modified' and other audit features.
|
||||
*/
|
||||
@FunctionalInterface
|
||||
public interface CurrentUserProvider {
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,6 +3,7 @@ package io.ebean.config;
|
||||
/**
|
||||
* Programmatically define which database columns are encrypted.
|
||||
*/
|
||||
@FunctionalInterface
|
||||
public interface EncryptDeployManager {
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,6 +6,7 @@ package io.ebean.config;
|
||||
* For simple cases this often represent a simple String key but depending on
|
||||
* the encryption method this could contain other details.
|
||||
*/
|
||||
@FunctionalInterface
|
||||
public interface EncryptKey {
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,6 +3,7 @@ package io.ebean.config;
|
||||
/**
|
||||
* Determine keys used for encryption and decryption.
|
||||
*/
|
||||
@FunctionalInterface
|
||||
public interface EncryptKeyManager {
|
||||
|
||||
/**
|
||||
@@ -11,7 +12,7 @@ public interface EncryptKeyManager {
|
||||
* This gives the EncryptKeyManager the opportunity to get keys etc.
|
||||
* </p>
|
||||
*/
|
||||
void initialise();
|
||||
default void initialise() {};
|
||||
|
||||
/**
|
||||
* Return the key used to encrypt and decrypt a property mapping to the given
|
||||
|
||||
@@ -5,6 +5,7 @@ import javax.sql.DataSource;
|
||||
/**
|
||||
* For multi-tenancy via DB supply the DataSource given the tenantId.
|
||||
*/
|
||||
@FunctionalInterface
|
||||
public interface TenantDataSourceProvider {
|
||||
|
||||
/**
|
||||
@@ -15,5 +16,5 @@ public interface TenantDataSourceProvider {
|
||||
/**
|
||||
* Shutdown all the DataSources.
|
||||
*/
|
||||
void shutdown(boolean deregisterDriver);
|
||||
default void shutdown(boolean deregisterDriver) {};
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package io.ebean.config;
|
||||
/**
|
||||
* For multi-tenancy via DB SCHEMA supply the schema given the tenantId.
|
||||
*/
|
||||
@FunctionalInterface
|
||||
public interface TenantSchemaProvider {
|
||||
|
||||
/**
|
||||
|
||||
@@ -13,6 +13,7 @@ public class DbPlatformTypeMapping {
|
||||
private static DbPlatformTypeLookup lookup = new DbPlatformTypeLookup();
|
||||
|
||||
private static final DbPlatformType UUID_NATIVE = new DbPlatformType("uuid", false);
|
||||
@SuppressWarnings("unused")
|
||||
private static final DbPlatformType UUID_PLACEHOLDER = new DbPlatformType("uuidPlaceholder");
|
||||
private static final DbPlatformType JSON_CLOB_PLACEHOLDER = new DbPlatformType("jsonClobPlaceholder");
|
||||
private static final DbPlatformType JSON_BLOB_PLACEHOLDER = new DbPlatformType("jsonBlobPlaceholder");
|
||||
|
||||
@@ -1642,7 +1642,6 @@ public class BeanDescriptor<T> implements MetaBeanInfo, BeanType<T> {
|
||||
* a reference (then {@link BeanPostLoad#postLoad(Object)} will be invoked
|
||||
* on first access (lazy load) or immediately (eager load)
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public EntityBean createEntityBean(boolean isNew) {
|
||||
try {
|
||||
EntityBean bean = (EntityBean) prototypeEntityBean._ebean_newInstance();
|
||||
@@ -2392,7 +2391,6 @@ public class BeanDescriptor<T> implements MetaBeanInfo, BeanType<T> {
|
||||
/**
|
||||
* Register the new BeanPersistController.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public void register(BeanPersistListener newPersistListener) {
|
||||
|
||||
if (newPersistListener.isRegisterFor(beanType)) {
|
||||
|
||||
@@ -12,7 +12,6 @@ import io.ebeaninternal.server.deploy.BeanDescriptor;
|
||||
import io.ebeaninternal.server.querydefn.OrmQueryProperties;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
||||
@@ -195,7 +195,6 @@ public class CQuery<T> implements DbReadContext, CancelableQuery {
|
||||
/**
|
||||
* Create the Sql select based on the request.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public CQuery(OrmQueryRequest<T> request, CQueryPredicates predicates, CQueryPlan queryPlan) {
|
||||
this.request = request;
|
||||
this.queryPlan = queryPlan;
|
||||
@@ -537,7 +536,6 @@ public class CQuery<T> implements DbReadContext, CancelableQuery {
|
||||
/**
|
||||
* Read version beans and their effective dates.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
List<Version<T>> readVersions() throws SQLException {
|
||||
|
||||
List<Version<T>> versionList = new ArrayList<>();
|
||||
|
||||
@@ -424,7 +424,6 @@ public final class DefaultTypeManager implements TypeManager {
|
||||
* </p>
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public ScalarType<?> getScalarType(Class<?> type, int jdbcType) {
|
||||
|
||||
// File is a special Lob so check for that first
|
||||
|
||||
@@ -113,7 +113,6 @@ public abstract class ScalarTypeBaseDate<T> extends ScalarTypeBase<T> {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void writeData(DataOutput dataOutput, T value) throws IOException {
|
||||
|
||||
if (value == null) {
|
||||
|
||||
@@ -64,14 +64,12 @@ public class ScalarTypeWrapper<B, S> implements ScalarType<B> {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public B readData(DataInput dataInput) throws IOException {
|
||||
S unwrapValue = scalarType.readData(dataInput);
|
||||
return converter.wrapValue(unwrapValue);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void writeData(DataOutput dataOutput, B value) throws IOException {
|
||||
S unwrapValue = converter.unwrapValue(value);
|
||||
scalarType.writeData(dataOutput, unwrapValue);
|
||||
|
||||
Reference in New Issue
Block a user