-
Notifications
You must be signed in to change notification settings - Fork 199
/
TrueFalseType.java
35 lines (29 loc) · 987 Bytes
/
TrueFalseType.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
* Hibernate OGM, Domain model persistence for NoSQL datastores
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.ogm.type.impl;
import org.hibernate.MappingException;
import org.hibernate.engine.spi.Mapping;
import org.hibernate.ogm.type.descriptor.impl.CharMappedGridTypeDescriptor;
/**
* Maps {@link Boolean} to {@code T} or {@code F} characters.
*
* @author Gunnar Morling
*/
public class TrueFalseType extends AbstractGenericBasicType<Boolean> {
public static final TrueFalseType INSTANCE = new TrueFalseType();
public TrueFalseType() {
super( CharMappedGridTypeDescriptor.INSTANCE, org.hibernate.type.TrueFalseType.INSTANCE.getJavaTypeDescriptor() );
}
@Override
public int getColumnSpan(Mapping mapping) throws MappingException {
return 1;
}
@Override
public String getName() {
return "true_false";
}
}