|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.vladmihalcea.hibernate.type.ImmutableType<com.google.common.collect.Range>
com.vladmihalcea.hibernate.type.range.guava.PostgreSQLGuavaRangeType
public class PostgreSQLGuavaRangeType
Maps a Range object type to a PostgreSQL range
column type.
Supported range types:
| Nested Class Summary | |
|---|---|
static interface |
PostgreSQLGuavaRangeType.Function<T,R>
|
| Field Summary | |
|---|---|
static PostgreSQLGuavaRangeType |
INSTANCE
|
| Constructor Summary | |
|---|---|
PostgreSQLGuavaRangeType()
|
|
| Method Summary | ||
|---|---|---|
String |
asString(com.google.common.collect.Range range)
|
|
static com.google.common.collect.Range<BigDecimal> |
bigDecimalRange(String range)
Creates the BigDecimal range from provided string: |
|
protected com.google.common.collect.Range |
get(ResultSet rs,
String[] names,
org.hibernate.engine.spi.SessionImplementor session,
Object owner)
Get the column value from the JDBC ResultSet. |
|
static com.google.common.collect.Range<Integer> |
integerRange(String range)
Creates the Integer range from provided string: |
|
static com.google.common.collect.Range<Long> |
longRange(String range)
Creates the Long range from provided string: |
|
static
|
ofString(String str,
PostgreSQLGuavaRangeType.Function<String,T> converter,
Class<T> cls)
|
|
protected void |
set(PreparedStatement st,
com.google.common.collect.Range range,
int index,
org.hibernate.engine.spi.SessionImplementor session)
Set the column value on the provided JDBC PreparedStatement. |
|
int[] |
sqlTypes()
|
|
| Methods inherited from class com.vladmihalcea.hibernate.type.ImmutableType |
|---|
assemble, assemble, beforeAssemble, compare, deepCopy, deepCopy, defaultSizes, dictatedSizes, disassemble, disassemble, equals, fromXMLNode, getColumnSpan, getConfiguration, getHashCode, getHashCode, getName, getRegistrationKeys, getReturnedClass, getSemiResolvedType, hashCode, hydrate, isAnyType, isAssociationType, isCollectionType, isComponentType, isDirty, isDirty, isDirty, isEntityType, isEqual, isEqual, isModified, isMutable, isSame, isXMLElement, nullSafeGet, nullSafeGet, nullSafeSet, nullSafeSet, replace, replace, replace, resolve, returnedClass, semiResolve, setToXMLNode, sqlTypes, toColumnNullness, toLoggableString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final PostgreSQLGuavaRangeType INSTANCE
| Constructor Detail |
|---|
public PostgreSQLGuavaRangeType()
| Method Detail |
|---|
public int[] sqlTypes()
protected com.google.common.collect.Range get(ResultSet rs,
String[] names,
org.hibernate.engine.spi.SessionImplementor session,
Object owner)
throws SQLException
ImmutableTypeResultSet.
get in class ImmutableType<com.google.common.collect.Range>rs - JDBC ResultSetnames - database column namesession - current Hibernate Sessionowner - current Hibernate SessionFactory
SQLException - in case of failure
protected void set(PreparedStatement st,
com.google.common.collect.Range range,
int index,
org.hibernate.engine.spi.SessionImplementor session)
throws SQLException
ImmutableTypePreparedStatement.
set in class ImmutableType<com.google.common.collect.Range>st - JDBC PreparedStatementrange - database column valueindex - database column indexsession - current Hibernate Session
SQLException - in case of failure
public static <T extends Comparable> com.google.common.collect.Range<T> ofString(String str,
PostgreSQLGuavaRangeType.Function<String,T> converter,
Class<T> cls)
public static com.google.common.collect.Range<BigDecimal> bigDecimalRange(String range)
BigDecimal range from provided string:
Range<BigDecimal> closed = Range.bigDecimalRange("[0.1,1.1]");
Range<BigDecimal> halfOpen = Range.bigDecimalRange("(0.1,1.1]");
Range<BigDecimal> open = Range.bigDecimalRange("(0.1,1.1)");
Range<BigDecimal> leftUnbounded = Range.bigDecimalRange("(,1.1)");
range - The range string, for example "[5.5,7.8]".
BigDecimals.
NumberFormatException - when one of the bounds are invalid.public static com.google.common.collect.Range<Integer> integerRange(String range)
Integer range from provided string:
Range<Integer> closed = Range.integerRange("[1,5]");
Range<Integer> halfOpen = Range.integerRange("(-1,1]");
Range<Integer> open = Range.integerRange("(1,2)");
Range<Integer> leftUnbounded = Range.integerRange("(,10)");
Range<Integer> unbounded = Range.integerRange("(,)");
range - The range string, for example "[5,7]".
Integers.
NumberFormatException - when one of the bounds are invalid.public static com.google.common.collect.Range<Long> longRange(String range)
Long range from provided string:
Range<Long> closed = Range.longRange("[1,5]");
Range<Long> halfOpen = Range.longRange("(-1,1]");
Range<Long> open = Range.longRange("(1,2)");
Range<Long> leftUnbounded = Range.longRange("(,10)");
Range<Long> unbounded = Range.longRange("(,)");
range - The range string, for example "[5,7]".
Longs.
NumberFormatException - when one of the bounds are invalid.public String asString(com.google.common.collect.Range range)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||