DATACASS-547 - Resolve converter ambiguities.

We now properly annotate read and writing converters to indicate proper conversion directions.
This commit is contained in:
Mark Paluch
2018-04-19 10:06:31 +02:00
parent 1a5ded6b91
commit 3aad62627f
3 changed files with 8 additions and 1 deletions

View File

@@ -24,6 +24,7 @@ import org.joda.time.LocalDate;
import org.joda.time.LocalTime;
import org.springframework.core.convert.converter.Converter;
import org.springframework.data.cassandra.core.mapping.CassandraType;
import org.springframework.data.convert.ReadingConverter;
import org.springframework.data.convert.WritingConverter;
import org.springframework.util.ClassUtils;
@@ -105,6 +106,7 @@ public abstract class CassandraJodaTimeConverters {
*
* @author Mark Paluch
*/
@ReadingConverter
public enum MillisOfDayToLocalTimeConverter implements Converter<Long, LocalTime> {
INSTANCE;

View File

@@ -25,6 +25,7 @@ import java.util.concurrent.TimeUnit;
import org.springframework.core.convert.converter.Converter;
import org.springframework.data.cassandra.core.mapping.CassandraType;
import org.springframework.data.convert.ReadingConverter;
import org.springframework.data.convert.WritingConverter;
import com.datastax.driver.core.DataType.Name;
@@ -62,6 +63,7 @@ public abstract class CassandraJsr310Converters {
*
* @author Mark Paluch
*/
@ReadingConverter
public enum CassandraLocalDateToLocalDateConverter
implements Converter<com.datastax.driver.core.LocalDate, LocalDate> {
@@ -78,6 +80,7 @@ public abstract class CassandraJsr310Converters {
*
* @author Mark Paluch
*/
@WritingConverter
public enum LocalDateToCassandraLocalDateConverter
implements Converter<LocalDate, com.datastax.driver.core.LocalDate> {
@@ -96,6 +99,7 @@ public abstract class CassandraJsr310Converters {
* @author Mark Paluch
* @since 2.1
*/
@ReadingConverter
public enum MillisOfDayToLocalTimeConverter implements Converter<Long, LocalTime> {
INSTANCE;

View File

@@ -23,6 +23,7 @@ import java.util.concurrent.TimeUnit;
import org.springframework.core.convert.converter.Converter;
import org.springframework.data.cassandra.core.mapping.CassandraType;
import org.springframework.data.convert.ReadingConverter;
import org.springframework.data.convert.ThreeTenBackPortConverters;
import org.springframework.data.convert.WritingConverter;
import org.springframework.util.ClassUtils;
@@ -112,7 +113,7 @@ public abstract class CassandraThreeTenBackPortConverters {
* @author Mark Paluch
* @since 2.1
*/
@ReadingConverter
public enum MillisOfDayToLocalTimeConverter implements Converter<Long, LocalTime> {
INSTANCE;