DATAJDBC-138 - Improve package structure and naming.
Moved SimpleJdbcRepository into support package. Moved mapping package under core. Renamed JdbcEntityOperations to JdbcAggregateOperations.
This commit is contained in:
committed by
Oliver Gierke
parent
d0a8af21a3
commit
bd7401b665
@@ -21,7 +21,7 @@ import java.util.Map;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
|
||||
import org.springframework.data.jdbc.mapping.model.JdbcPersistentProperty;
|
||||
import org.springframework.data.jdbc.core.mapping.model.JdbcPersistentProperty;
|
||||
import org.springframework.data.mapping.PropertyPath;
|
||||
|
||||
/**
|
||||
|
||||
@@ -17,7 +17,7 @@ package org.springframework.data.jdbc.core;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.data.jdbc.mapping.model.JdbcPersistentProperty;
|
||||
import org.springframework.data.jdbc.core.mapping.model.JdbcPersistentProperty;
|
||||
import org.springframework.data.mapping.PropertyPath;
|
||||
|
||||
/**
|
||||
|
||||
@@ -27,11 +27,11 @@ import java.util.stream.StreamSupport;
|
||||
import org.springframework.dao.EmptyResultDataAccessException;
|
||||
import org.springframework.dao.InvalidDataAccessApiUsageException;
|
||||
import org.springframework.dao.NonTransientDataAccessException;
|
||||
import org.springframework.data.jdbc.mapping.model.BasicJdbcPersistentEntityInformation;
|
||||
import org.springframework.data.jdbc.mapping.model.JdbcMappingContext;
|
||||
import org.springframework.data.jdbc.mapping.model.JdbcPersistentEntity;
|
||||
import org.springframework.data.jdbc.mapping.model.JdbcPersistentEntityInformation;
|
||||
import org.springframework.data.jdbc.mapping.model.JdbcPersistentProperty;
|
||||
import org.springframework.data.jdbc.core.mapping.model.BasicJdbcPersistentEntityInformation;
|
||||
import org.springframework.data.jdbc.core.mapping.model.JdbcMappingContext;
|
||||
import org.springframework.data.jdbc.core.mapping.model.JdbcPersistentEntity;
|
||||
import org.springframework.data.jdbc.core.mapping.model.JdbcPersistentEntityInformation;
|
||||
import org.springframework.data.jdbc.core.mapping.model.JdbcPersistentProperty;
|
||||
import org.springframework.data.jdbc.support.JdbcUtil;
|
||||
import org.springframework.data.mapping.PropertyHandler;
|
||||
import org.springframework.data.mapping.PropertyPath;
|
||||
|
||||
@@ -24,8 +24,8 @@ import org.springframework.data.jdbc.core.conversion.DbAction.DeleteAll;
|
||||
import org.springframework.data.jdbc.core.conversion.DbAction.Insert;
|
||||
import org.springframework.data.jdbc.core.conversion.DbAction.Update;
|
||||
import org.springframework.data.jdbc.core.conversion.Interpreter;
|
||||
import org.springframework.data.jdbc.mapping.model.JdbcMappingContext;
|
||||
import org.springframework.data.jdbc.mapping.model.JdbcPersistentEntity;
|
||||
import org.springframework.data.jdbc.core.mapping.model.JdbcMappingContext;
|
||||
import org.springframework.data.jdbc.core.mapping.model.JdbcPersistentEntity;
|
||||
import org.springframework.data.mapping.PropertyPath;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ package org.springframework.data.jdbc.core;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.data.jdbc.mapping.model.JdbcPersistentProperty;
|
||||
import org.springframework.data.jdbc.core.mapping.model.JdbcPersistentProperty;
|
||||
import org.springframework.data.mapping.PropertyPath;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
|
||||
@@ -26,9 +26,9 @@ import org.springframework.core.convert.ConversionService;
|
||||
import org.springframework.core.convert.converter.Converter;
|
||||
import org.springframework.data.convert.ClassGeneratingEntityInstantiator;
|
||||
import org.springframework.data.convert.EntityInstantiator;
|
||||
import org.springframework.data.jdbc.mapping.model.JdbcMappingContext;
|
||||
import org.springframework.data.jdbc.mapping.model.JdbcPersistentEntity;
|
||||
import org.springframework.data.jdbc.mapping.model.JdbcPersistentProperty;
|
||||
import org.springframework.data.jdbc.core.mapping.model.JdbcMappingContext;
|
||||
import org.springframework.data.jdbc.core.mapping.model.JdbcPersistentEntity;
|
||||
import org.springframework.data.jdbc.core.mapping.model.JdbcPersistentProperty;
|
||||
import org.springframework.data.mapping.MappingException;
|
||||
import org.springframework.data.mapping.PersistentProperty;
|
||||
import org.springframework.data.mapping.PersistentPropertyAccessor;
|
||||
|
||||
@@ -21,7 +21,7 @@ package org.springframework.data.jdbc.core;
|
||||
* @author Jens Schauder
|
||||
* @since 1.0
|
||||
*/
|
||||
public interface JdbcEntityOperations {
|
||||
public interface JdbcAggregateOperations {
|
||||
|
||||
<T> void save(T instance, Class<T> domainType);
|
||||
|
||||
@@ -23,24 +23,24 @@ import org.springframework.data.jdbc.core.conversion.AggregateChange.Kind;
|
||||
import org.springframework.data.jdbc.core.conversion.Interpreter;
|
||||
import org.springframework.data.jdbc.core.conversion.JdbcEntityDeleteWriter;
|
||||
import org.springframework.data.jdbc.core.conversion.JdbcEntityWriter;
|
||||
import org.springframework.data.jdbc.mapping.event.AfterDeleteEvent;
|
||||
import org.springframework.data.jdbc.mapping.event.AfterLoadEvent;
|
||||
import org.springframework.data.jdbc.mapping.event.AfterSaveEvent;
|
||||
import org.springframework.data.jdbc.mapping.event.BeforeDeleteEvent;
|
||||
import org.springframework.data.jdbc.mapping.event.BeforeSaveEvent;
|
||||
import org.springframework.data.jdbc.mapping.event.Identifier;
|
||||
import org.springframework.data.jdbc.mapping.event.Identifier.Specified;
|
||||
import org.springframework.data.jdbc.mapping.model.JdbcMappingContext;
|
||||
import org.springframework.data.jdbc.mapping.model.JdbcPersistentEntityInformation;
|
||||
import org.springframework.data.jdbc.core.mapping.event.AfterDeleteEvent;
|
||||
import org.springframework.data.jdbc.core.mapping.event.AfterLoadEvent;
|
||||
import org.springframework.data.jdbc.core.mapping.event.AfterSaveEvent;
|
||||
import org.springframework.data.jdbc.core.mapping.event.BeforeDeleteEvent;
|
||||
import org.springframework.data.jdbc.core.mapping.event.BeforeSaveEvent;
|
||||
import org.springframework.data.jdbc.core.mapping.event.Identifier;
|
||||
import org.springframework.data.jdbc.core.mapping.event.Identifier.Specified;
|
||||
import org.springframework.data.jdbc.core.mapping.model.JdbcMappingContext;
|
||||
import org.springframework.data.jdbc.core.mapping.model.JdbcPersistentEntityInformation;
|
||||
|
||||
/**
|
||||
* {@link JdbcEntityOperations} implementation, storing aggregates in and obtaining them from a JDBC data store.
|
||||
* {@link JdbcAggregateOperations} implementation, storing aggregates in and obtaining them from a JDBC data store.
|
||||
*
|
||||
* @author Jens Schauder
|
||||
* @author Mark Paluch
|
||||
* @since 1.0
|
||||
*/
|
||||
public class JdbcEntityTemplate implements JdbcEntityOperations {
|
||||
public class JdbcAggregateTemplate implements JdbcAggregateOperations {
|
||||
|
||||
private final ApplicationEventPublisher publisher;
|
||||
private final JdbcMappingContext context;
|
||||
@@ -51,8 +51,8 @@ public class JdbcEntityTemplate implements JdbcEntityOperations {
|
||||
|
||||
private final DataAccessStrategy accessStrategy;
|
||||
|
||||
public JdbcEntityTemplate(ApplicationEventPublisher publisher, JdbcMappingContext context,
|
||||
DataAccessStrategy dataAccessStrategy) {
|
||||
public JdbcAggregateTemplate(ApplicationEventPublisher publisher, JdbcMappingContext context,
|
||||
DataAccessStrategy dataAccessStrategy) {
|
||||
|
||||
this.publisher = publisher;
|
||||
this.context = context;
|
||||
@@ -24,7 +24,7 @@ import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Builder for creating Select-statements. Not intended for general purpose, but only for the needs of the
|
||||
* {@link JdbcEntityTemplate}.
|
||||
* {@link JdbcAggregateTemplate}.
|
||||
*
|
||||
* @author Jens Schauder
|
||||
* @since 1.0
|
||||
|
||||
@@ -15,10 +15,10 @@
|
||||
*/
|
||||
package org.springframework.data.jdbc.core;
|
||||
|
||||
import org.springframework.data.jdbc.mapping.model.JdbcMappingContext;
|
||||
import org.springframework.data.jdbc.mapping.model.JdbcPersistentEntity;
|
||||
import org.springframework.data.jdbc.mapping.model.JdbcPersistentProperty;
|
||||
import org.springframework.data.jdbc.repository.SimpleJdbcRepository;
|
||||
import org.springframework.data.jdbc.core.mapping.model.JdbcMappingContext;
|
||||
import org.springframework.data.jdbc.core.mapping.model.JdbcPersistentEntity;
|
||||
import org.springframework.data.jdbc.core.mapping.model.JdbcPersistentProperty;
|
||||
import org.springframework.data.jdbc.repository.support.SimpleJdbcRepository;
|
||||
import org.springframework.data.mapping.PropertyHandler;
|
||||
import org.springframework.data.mapping.PropertyPath;
|
||||
import org.springframework.data.util.Lazy;
|
||||
|
||||
@@ -20,7 +20,7 @@ import lombok.RequiredArgsConstructor;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.data.jdbc.mapping.model.JdbcMappingContext;
|
||||
import org.springframework.data.jdbc.core.mapping.model.JdbcMappingContext;
|
||||
|
||||
/**
|
||||
* Provides {@link SqlGenerator}s per domain type. Instances get cached, so when asked multiple times for the same domain
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
package org.springframework.data.jdbc.core.conversion;
|
||||
|
||||
import org.springframework.data.jdbc.mapping.model.JdbcMappingContext;
|
||||
import org.springframework.data.jdbc.core.mapping.model.JdbcMappingContext;
|
||||
|
||||
/**
|
||||
* Converts an entity that is about to be deleted into {@link DbAction}s inside a {@link AggregateChange} that need to be
|
||||
|
||||
@@ -25,10 +25,10 @@ import java.util.stream.Stream;
|
||||
|
||||
import org.springframework.data.jdbc.core.conversion.DbAction.Insert;
|
||||
import org.springframework.data.jdbc.core.conversion.DbAction.Update;
|
||||
import org.springframework.data.jdbc.mapping.model.JdbcMappingContext;
|
||||
import org.springframework.data.jdbc.mapping.model.JdbcPersistentEntity;
|
||||
import org.springframework.data.jdbc.mapping.model.JdbcPersistentEntityInformation;
|
||||
import org.springframework.data.jdbc.mapping.model.JdbcPersistentProperty;
|
||||
import org.springframework.data.jdbc.core.mapping.model.JdbcMappingContext;
|
||||
import org.springframework.data.jdbc.core.mapping.model.JdbcPersistentEntity;
|
||||
import org.springframework.data.jdbc.core.mapping.model.JdbcPersistentEntityInformation;
|
||||
import org.springframework.data.jdbc.core.mapping.model.JdbcPersistentProperty;
|
||||
import org.springframework.data.mapping.PersistentProperty;
|
||||
import org.springframework.data.mapping.PersistentPropertyAccessor;
|
||||
import org.springframework.data.util.StreamUtils;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
package org.springframework.data.jdbc.core.conversion;
|
||||
|
||||
import org.springframework.data.convert.EntityWriter;
|
||||
import org.springframework.data.jdbc.mapping.model.JdbcMappingContext;
|
||||
import org.springframework.data.jdbc.core.mapping.model.JdbcMappingContext;
|
||||
|
||||
/**
|
||||
* Common infrastructure needed by different implementations of {@link EntityWriter}<Object, AggregateChange>.
|
||||
|
||||
@@ -13,12 +13,12 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.data.jdbc.mapping.event;
|
||||
package org.springframework.data.jdbc.core.mapping.event;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import org.springframework.data.jdbc.core.conversion.AggregateChange;
|
||||
import org.springframework.data.jdbc.mapping.event.Identifier.Specified;
|
||||
import org.springframework.data.jdbc.core.mapping.event.Identifier.Specified;
|
||||
|
||||
/**
|
||||
* Gets published after deletion of an entity. It will have a {@link Specified} identifier. If the entity is empty or
|
||||
@@ -13,9 +13,9 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.data.jdbc.mapping.event;
|
||||
package org.springframework.data.jdbc.core.mapping.event;
|
||||
|
||||
import org.springframework.data.jdbc.mapping.event.Identifier.Specified;
|
||||
import org.springframework.data.jdbc.core.mapping.event.Identifier.Specified;
|
||||
|
||||
/**
|
||||
* Gets published after instantiation and setting of all the properties of an entity. This allows to do some
|
||||
@@ -13,10 +13,10 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.data.jdbc.mapping.event;
|
||||
package org.springframework.data.jdbc.core.mapping.event;
|
||||
|
||||
import org.springframework.data.jdbc.core.conversion.AggregateChange;
|
||||
import org.springframework.data.jdbc.mapping.event.Identifier.Specified;
|
||||
import org.springframework.data.jdbc.core.mapping.event.Identifier.Specified;
|
||||
|
||||
/**
|
||||
* Subclasses of this get published after a new instance or a changed instance was saved in the database.
|
||||
@@ -13,12 +13,12 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.data.jdbc.mapping.event;
|
||||
package org.springframework.data.jdbc.core.mapping.event;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import org.springframework.data.jdbc.core.conversion.AggregateChange;
|
||||
import org.springframework.data.jdbc.mapping.event.Identifier.Specified;
|
||||
import org.springframework.data.jdbc.core.mapping.event.Identifier.Specified;
|
||||
|
||||
/**
|
||||
* Gets published when an entity is about to get deleted.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.data.jdbc.mapping.event;
|
||||
package org.springframework.data.jdbc.core.mapping.event;
|
||||
|
||||
import org.springframework.data.jdbc.core.conversion.AggregateChange;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.data.jdbc.mapping.event;
|
||||
package org.springframework.data.jdbc.core.mapping.event;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.data.jdbc.mapping.event;
|
||||
package org.springframework.data.jdbc.core.mapping.event;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.data.jdbc.mapping.event;
|
||||
package org.springframework.data.jdbc.core.mapping.event;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
@@ -13,12 +13,12 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.data.jdbc.mapping.event;
|
||||
package org.springframework.data.jdbc.core.mapping.event;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import org.springframework.data.jdbc.core.conversion.AggregateChange;
|
||||
import org.springframework.data.jdbc.mapping.event.Identifier.Specified;
|
||||
import org.springframework.data.jdbc.core.mapping.event.Identifier.Specified;
|
||||
|
||||
/**
|
||||
* A {@link SimpleJdbcEvent} guaranteed to have an identifier.
|
||||
@@ -41,7 +41,7 @@ public class JdbcEventWithId extends SimpleJdbcEvent implements WithId {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.jdbc.mapping.event.JdbcEvent#getId()
|
||||
* @see org.springframework.data.jdbc.core.mapping.event.JdbcEvent#getId()
|
||||
*/
|
||||
@Override
|
||||
public Specified getId() {
|
||||
@@ -13,14 +13,14 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.data.jdbc.mapping.event;
|
||||
package org.springframework.data.jdbc.core.mapping.event;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import org.springframework.data.jdbc.core.conversion.AggregateChange;
|
||||
import org.springframework.data.jdbc.mapping.event.Identifier.Specified;
|
||||
import org.springframework.data.jdbc.core.mapping.event.Identifier.Specified;
|
||||
|
||||
/**
|
||||
* A {@link SimpleJdbcEvent} which is guaranteed to have an identifier and an entity.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.data.jdbc.mapping.event;
|
||||
package org.springframework.data.jdbc.core.mapping.event;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
@@ -45,7 +45,7 @@ class SimpleJdbcEvent extends ApplicationEvent implements JdbcEvent {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.jdbc.mapping.event.JdbcEvent#getId()
|
||||
* @see org.springframework.data.jdbc.core.mapping.event.JdbcEvent#getId()
|
||||
*/
|
||||
@Override
|
||||
public Identifier getId() {
|
||||
@@ -54,7 +54,7 @@ class SimpleJdbcEvent extends ApplicationEvent implements JdbcEvent {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.jdbc.mapping.event.JdbcEvent#getOptionalEntity()
|
||||
* @see org.springframework.data.jdbc.core.mapping.event.JdbcEvent#getOptionalEntity()
|
||||
*/
|
||||
@Override
|
||||
public Optional<Object> getOptionalEntity() {
|
||||
@@ -13,13 +13,13 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.data.jdbc.mapping.event;
|
||||
package org.springframework.data.jdbc.core.mapping.event;
|
||||
|
||||
import lombok.Value;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import org.springframework.data.jdbc.mapping.event.Identifier.Specified;
|
||||
import org.springframework.data.jdbc.core.mapping.event.Identifier.Specified;
|
||||
|
||||
/**
|
||||
* Simple value object for {@link Specified}.
|
||||
@@ -35,7 +35,7 @@ class SpecifiedIdentifier implements Specified {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.jdbc.mapping.event.Identifier#getOptionalValue()
|
||||
* @see org.springframework.data.jdbc.core.mapping.event.Identifier#getOptionalValue()
|
||||
*/
|
||||
@Override
|
||||
public Optional<? extends Object> getOptionalValue() {
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.data.jdbc.mapping.event;
|
||||
package org.springframework.data.jdbc.core.mapping.event;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
@@ -30,7 +30,7 @@ enum Unset implements Identifier {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.jdbc.mapping.event.Identifier#getOptionalValue()
|
||||
* @see org.springframework.data.jdbc.core.mapping.event.Identifier#getOptionalValue()
|
||||
*/
|
||||
@Override
|
||||
public Optional<Object> getOptionalValue() {
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.data.jdbc.mapping.event;
|
||||
package org.springframework.data.jdbc.core.mapping.event;
|
||||
|
||||
/**
|
||||
* Interface for {@link SimpleJdbcEvent}s which are guaranteed to have an entity. Allows direct access to that entity,
|
||||
@@ -13,9 +13,9 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.data.jdbc.mapping.event;
|
||||
package org.springframework.data.jdbc.core.mapping.event;
|
||||
|
||||
import org.springframework.data.jdbc.mapping.event.Identifier.Specified;
|
||||
import org.springframework.data.jdbc.core.mapping.event.Identifier.Specified;
|
||||
|
||||
/**
|
||||
* Interface for {@link SimpleJdbcEvent}s which are guaranteed to have a {@link Specified} identifier. Offers direct
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.data.jdbc.mapping.model;
|
||||
package org.springframework.data.jdbc.core.mapping.model;
|
||||
|
||||
import org.springframework.data.domain.Persistable;
|
||||
import org.springframework.data.repository.core.support.PersistentEntityInformation;
|
||||
@@ -49,7 +49,7 @@ public class BasicJdbcPersistentEntityInformation<T, ID> extends PersistentEntit
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.jdbc.mapping.model.JdbcPersistentEntityInformation#setId(java.lang.Object, java.util.Optional)
|
||||
* @see org.springframework.data.jdbc.core.mapping.model.JdbcPersistentEntityInformation#setId(java.lang.Object, java.util.Optional)
|
||||
*/
|
||||
@Override
|
||||
public void setId(T instance, Object value) {
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.data.jdbc.mapping.model;
|
||||
package org.springframework.data.jdbc.core.mapping.model;
|
||||
|
||||
import java.time.ZonedDateTime;
|
||||
import java.time.temporal.Temporal;
|
||||
@@ -83,7 +83,7 @@ public class BasicJdbcPersistentProperty extends AnnotationBasedPersistentProper
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.jdbc.mapping.model.JdbcPersistentProperty#getColumnName()
|
||||
* @see org.springframework.data.jdbc.core.mapping.model.JdbcPersistentProperty#getColumnName()
|
||||
*/
|
||||
public String getColumnName() {
|
||||
return columnName.get().orElseGet(() -> context.getNamingStrategy().getColumnName(this));
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.data.jdbc.mapping.model;
|
||||
package org.springframework.data.jdbc.core.mapping.model;
|
||||
|
||||
import org.springframework.core.convert.support.GenericConversionService;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.data.jdbc.mapping.model;
|
||||
package org.springframework.data.jdbc.core.mapping.model;
|
||||
|
||||
import org.springframework.data.util.ParsingUtils;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.data.jdbc.mapping.model;
|
||||
package org.springframework.data.jdbc.core.mapping.model;
|
||||
|
||||
import static java.util.Arrays.*;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.data.jdbc.mapping.model;
|
||||
package org.springframework.data.jdbc.core.mapping.model;
|
||||
|
||||
import org.springframework.data.mapping.model.MutablePersistentEntity;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.data.jdbc.mapping.model;
|
||||
package org.springframework.data.jdbc.core.mapping.model;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
@@ -58,7 +58,7 @@ class JdbcPersistentEntityImpl<T> extends BasicPersistentEntity<T, JdbcPersisten
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.jdbc.mapping.model.JdbcPersistentEntity#getIdColumn()
|
||||
* @see org.springframework.data.jdbc.core.mapping.model.JdbcPersistentEntity#getIdColumn()
|
||||
*/
|
||||
@Override
|
||||
public String getIdColumn() {
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.data.jdbc.mapping.model;
|
||||
package org.springframework.data.jdbc.core.mapping.model;
|
||||
|
||||
import org.springframework.data.repository.core.EntityInformation;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.data.jdbc.mapping.model;
|
||||
package org.springframework.data.jdbc.core.mapping.model;
|
||||
|
||||
import org.springframework.data.mapping.PersistentProperty;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.data.jdbc.mapping.model;
|
||||
package org.springframework.data.jdbc.core.mapping.model;
|
||||
|
||||
/**
|
||||
* Interface and default implementation of a naming strategy. Defaults to no schema, table name based on {@link Class}
|
||||
@@ -19,7 +19,7 @@ import lombok.RequiredArgsConstructor;
|
||||
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.data.auditing.AuditingHandler;
|
||||
import org.springframework.data.jdbc.mapping.event.BeforeSaveEvent;
|
||||
import org.springframework.data.jdbc.core.mapping.event.BeforeSaveEvent;
|
||||
import org.springframework.data.jdbc.mapping.model.JdbcMappingContext;
|
||||
import org.springframework.data.jdbc.mapping.model.JdbcPersistentEntityInformation;
|
||||
import org.springframework.data.jdbc.repository.config.EnableJdbcAuditing;
|
||||
|
||||
@@ -27,8 +27,8 @@ import org.springframework.data.jdbc.core.DataAccessStrategy;
|
||||
import org.springframework.data.jdbc.core.DefaultDataAccessStrategy;
|
||||
import org.springframework.data.jdbc.core.DelegatingDataAccessStrategy;
|
||||
import org.springframework.data.jdbc.core.SqlGeneratorSource;
|
||||
import org.springframework.data.jdbc.mapping.model.JdbcMappingContext;
|
||||
import org.springframework.data.jdbc.mapping.model.JdbcPersistentProperty;
|
||||
import org.springframework.data.jdbc.core.mapping.model.JdbcMappingContext;
|
||||
import org.springframework.data.jdbc.core.mapping.model.JdbcPersistentProperty;
|
||||
import org.springframework.data.mapping.PropertyPath;
|
||||
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
@@ -19,9 +19,11 @@ import java.util.Optional;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.data.jdbc.mapping.model.ConversionCustomizer;
|
||||
import org.springframework.data.jdbc.mapping.model.JdbcMappingContext;
|
||||
import org.springframework.data.jdbc.mapping.model.NamingStrategy;
|
||||
import org.springframework.data.jdbc.core.mapping.model.ConversionCustomizer;
|
||||
import org.springframework.data.jdbc.core.mapping.model.JdbcMappingContext;
|
||||
import org.springframework.data.jdbc.core.mapping.model.NamingStrategy;
|
||||
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations;
|
||||
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
|
||||
|
||||
/**
|
||||
* Beans that must be registered for Spring Data JDBC to work.
|
||||
|
||||
@@ -20,7 +20,7 @@ import java.lang.reflect.Method;
|
||||
import org.springframework.core.convert.ConversionService;
|
||||
import org.springframework.data.jdbc.core.DataAccessStrategy;
|
||||
import org.springframework.data.jdbc.core.EntityRowMapper;
|
||||
import org.springframework.data.jdbc.mapping.model.JdbcMappingContext;
|
||||
import org.springframework.data.jdbc.core.mapping.model.JdbcMappingContext;
|
||||
import org.springframework.data.jdbc.repository.RowMapperMap;
|
||||
import org.springframework.data.projection.ProjectionFactory;
|
||||
import org.springframework.data.repository.core.NamedQueries;
|
||||
|
||||
@@ -19,11 +19,10 @@ import java.util.Optional;
|
||||
|
||||
import org.springframework.context.ApplicationEventPublisher;
|
||||
import org.springframework.data.jdbc.core.DataAccessStrategy;
|
||||
import org.springframework.data.jdbc.core.JdbcEntityTemplate;
|
||||
import org.springframework.data.jdbc.mapping.model.JdbcMappingContext;
|
||||
import org.springframework.data.jdbc.mapping.model.JdbcPersistentEntityInformation;
|
||||
import org.springframework.data.jdbc.core.JdbcAggregateTemplate;
|
||||
import org.springframework.data.jdbc.core.mapping.model.JdbcMappingContext;
|
||||
import org.springframework.data.jdbc.core.mapping.model.JdbcPersistentEntityInformation;
|
||||
import org.springframework.data.jdbc.repository.RowMapperMap;
|
||||
import org.springframework.data.jdbc.repository.SimpleJdbcRepository;
|
||||
import org.springframework.data.repository.core.EntityInformation;
|
||||
import org.springframework.data.repository.core.RepositoryInformation;
|
||||
import org.springframework.data.repository.core.RepositoryMetadata;
|
||||
@@ -98,7 +97,7 @@ public class JdbcRepositoryFactory extends RepositoryFactorySupport {
|
||||
JdbcPersistentEntityInformation<?, ?> persistentEntityInformation = context
|
||||
.getRequiredPersistentEntityInformation(repositoryInformation.getDomainType());
|
||||
|
||||
JdbcEntityTemplate template = new JdbcEntityTemplate(publisher, context, accessStrategy);
|
||||
JdbcAggregateTemplate template = new JdbcAggregateTemplate(publisher, context, accessStrategy);
|
||||
|
||||
return new SimpleJdbcRepository<>(template, persistentEntityInformation);
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.springframework.context.ApplicationEventPublisherAware;
|
||||
import org.springframework.data.jdbc.core.DataAccessStrategy;
|
||||
import org.springframework.data.jdbc.core.DefaultDataAccessStrategy;
|
||||
import org.springframework.data.jdbc.core.SqlGeneratorSource;
|
||||
import org.springframework.data.jdbc.mapping.model.JdbcMappingContext;
|
||||
import org.springframework.data.jdbc.core.mapping.model.JdbcMappingContext;
|
||||
import org.springframework.data.jdbc.repository.RowMapperMap;
|
||||
import org.springframework.data.repository.Repository;
|
||||
import org.springframework.data.repository.core.support.RepositoryFactorySupport;
|
||||
|
||||
@@ -17,7 +17,7 @@ package org.springframework.data.jdbc.repository.support;
|
||||
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.dao.EmptyResultDataAccessException;
|
||||
import org.springframework.data.jdbc.mapping.model.JdbcMappingContext;
|
||||
import org.springframework.data.jdbc.core.mapping.model.JdbcMappingContext;
|
||||
import org.springframework.data.repository.query.RepositoryQuery;
|
||||
import org.springframework.jdbc.core.RowMapper;
|
||||
import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.data.jdbc.repository;
|
||||
package org.springframework.data.jdbc.repository.support;
|
||||
|
||||
import lombok.NonNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -22,8 +22,8 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.springframework.data.jdbc.core.JdbcEntityOperations;
|
||||
import org.springframework.data.jdbc.mapping.model.JdbcPersistentEntityInformation;
|
||||
import org.springframework.data.jdbc.core.JdbcAggregateOperations;
|
||||
import org.springframework.data.jdbc.core.mapping.model.JdbcPersistentEntityInformation;
|
||||
import org.springframework.data.repository.CrudRepository;
|
||||
|
||||
/**
|
||||
@@ -34,8 +34,19 @@ import org.springframework.data.repository.CrudRepository;
|
||||
@RequiredArgsConstructor
|
||||
public class SimpleJdbcRepository<T, ID> implements CrudRepository<T, ID> {
|
||||
|
||||
private final @NonNull JdbcEntityOperations entityOperations;
|
||||
private final @NonNull JdbcPersistentEntityInformation<T, ID> entityInformation;
|
||||
private final JdbcPersistentEntityInformation<T, ID> entityInformation;
|
||||
|
||||
private final JdbcAggregateOperations entityOperations;
|
||||
|
||||
/**
|
||||
* Creates a new {@link SimpleJdbcRepository}.
|
||||
*/
|
||||
public SimpleJdbcRepository(JdbcAggregateTemplate entityOperations,
|
||||
JdbcPersistentEntityInformation<T, ID> entityInformation) {
|
||||
|
||||
this.entityOperations = entityOperations;
|
||||
this.entityInformation = entityInformation;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
Reference in New Issue
Block a user