public class CloudSpannerConversionUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static Object |
convert(Object value,
com.google.cloud.spanner.Type type,
Class<?> targetType)
Converts the given value from the Google
Type to the Java Class type. |
static List<com.google.cloud.ByteArray> |
toCloudSpannerBytes(byte[][] bytes) |
static com.google.cloud.Date |
toCloudSpannerDate(Date date) |
static List<com.google.cloud.Date> |
toCloudSpannerDates(Date[] dates) |
static com.google.cloud.Timestamp |
toCloudSpannerTimestamp(Timestamp ts) |
static List<com.google.cloud.Timestamp> |
toCloudSpannerTimestamps(Timestamp[] timestamps) |
static List<byte[]> |
toJavaByteArrays(List<com.google.cloud.ByteArray> bytes) |
static List<Date> |
toJavaDates(List<com.google.cloud.Date> dates) |
static List<Timestamp> |
toJavaTimestamps(List<com.google.cloud.Timestamp> timestamps) |
static Date |
toSqlDate(com.google.cloud.Date date) |
static Date |
toSqlDate(com.google.cloud.Date date,
Calendar cal) |
static Time |
toSqlTime(com.google.cloud.Timestamp ts) |
static Time |
toSqlTime(com.google.cloud.Timestamp ts,
Calendar cal) |
public static Date toSqlDate(com.google.cloud.Date date)
public static com.google.cloud.Date toCloudSpannerDate(Date date)
public static com.google.cloud.Timestamp toCloudSpannerTimestamp(Timestamp ts)
public static List<com.google.cloud.Timestamp> toCloudSpannerTimestamps(Timestamp[] timestamps)
public static Time toSqlTime(com.google.cloud.Timestamp ts)
public static List<Timestamp> toJavaTimestamps(List<com.google.cloud.Timestamp> timestamps)
public static List<com.google.cloud.ByteArray> toCloudSpannerBytes(byte[][] bytes)
public static List<byte[]> toJavaByteArrays(List<com.google.cloud.ByteArray> bytes)
public static Object convert(Object value, com.google.cloud.spanner.Type type, Class<?> targetType) throws CloudSpannerSQLException
Type to the Java Class type.value - The value to converttype - The type in the databasetargetType - The java class target type to convert toCloudSpannerSQLException - Thrown if the given value cannot be converted to the specified
typeCopyright © 2018. All rights reserved.