public GridType overrideType()

in mongodb/src/main/java/org/hibernate/ogm/datastore/mongodb/MongoDBDialect.java [841:906]


	public GridType overrideType(Type type) {
		// Override handling of calendar types
		if ( type == StandardBasicTypes.CALENDAR || type == StandardBasicTypes.CALENDAR_DATE ) {
			return StringCalendarDateType.INSTANCE;
		}
		else if ( type == StandardBasicTypes.TIMESTAMP ) {
			return TimestampAsDateType.INSTANCE;
		}
		else if ( type == StandardBasicTypes.BINARY ) {
			return BinaryAsBsonBinaryGridType.INSTANCE;
		}
		else if ( type == StandardBasicTypes.BYTE ) {
			return ByteStringType.INSTANCE;
		}
		else if ( type == StandardBasicTypes.CHARACTER ) {
			return CharacterStringType.INSTANCE;
		}
		else if ( type.getReturnedClass() == ObjectId.class ) {
			return ObjectIdGridType.INSTANCE;
		}
		else if ( type instanceof StringAsObjectIdType ) {
			return StringAsObjectIdGridType.INSTANCE;
		}
		else if ( type == GridFSType.INSTANCE ) {
			return GridFSGridType.INSTANCE;
		}
		else if ( type instanceof SerializableToBlobType ) {
			SerializableToBlobType<?> exposedType = (SerializableToBlobType<?>) type;
			return new SerializableAsBinaryGridType<>( exposedType.getJavaTypeDescriptor() );
		}
		else if ( type instanceof MaterializedBlobType ) {
			MaterializedBlobType exposedType = (MaterializedBlobType) type;
			return new SerializableAsBinaryGridType<>( exposedType.getJavaTypeDescriptor() );
		}
		else if ( type.getReturnedClass() == GeoPoint.class ) {
			return GeoPointGridType.INSTANCE;
		}
		else if ( type.getReturnedClass() == GeoMultiPoint.class ) {
			return GeoMultiPointGridType.INSTANCE;
		}
		else if ( type.getReturnedClass() == GeoLineString.class ) {
			return GeoLineStringGridType.INSTANCE;
		}
		else if ( type.getReturnedClass() == GeoMultiLineString.class ) {
			return GeoMultiLineStringGridType.INSTANCE;
		}
		else if ( type.getReturnedClass() == GeoPolygon.class ) {
			return GeoPolygonGridType.INSTANCE;
		}
		else if ( type.getReturnedClass() == GeoMultiPolygon.class ) {
			return GeoMultiPolygonGridType.INSTANCE;
		}
		else if ( type.getReturnedClass() == GeoCollection.class ) {
			return GeoCollectionGridType.INSTANCE;
		}
		else if ( type.getReturnedClass().equals( LocalDate.class ) ) {
			return LocalDateAsStringType.INSTANCE;
		}
		else if ( type.getReturnedClass().equals( LocalDateTime.class ) ) {
			return LocalDateTimeAsStringType.INSTANCE;
		}
		else if ( type.getReturnedClass().equals( LocalTime.class ) ) {
			return LocalTimeAsStringType.INSTANCE;
		}
		return null; // all other types handled as in hibernate-ogm-core
	}