HStreams

Hibernate JDK 8 wrapper

License

License

GroupId

GroupId

com.github.jmnarloch
ArtifactId

ArtifactId

hstreams43
Last Version

Last Version

1.0.2
Release Date

Release Date

Type

Type

jar
Description

Description

HStreams
Hibernate JDK 8 wrapper
Project URL

Project URL

https://github.com/jmnarloch/hstreams
Source Code Management

Source Code Management

https://github.com/jmnarloch/hstreams.git

Download hstreams43

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.jmnarloch/hstreams43/ -->
<dependency>
    <groupId>com.github.jmnarloch</groupId>
    <artifactId>hstreams43</artifactId>
    <version>1.0.2</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.jmnarloch/hstreams43/
implementation 'com.github.jmnarloch:hstreams43:1.0.2'
// https://jarcasting.com/artifacts/com.github.jmnarloch/hstreams43/
implementation ("com.github.jmnarloch:hstreams43:1.0.2")
'com.github.jmnarloch:hstreams43:jar:1.0.2'
<dependency org="com.github.jmnarloch" name="hstreams43" rev="1.0.2">
  <artifact name="hstreams43" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.jmnarloch', module='hstreams43', version='1.0.2')
)
libraryDependencies += "com.github.jmnarloch" % "hstreams43" % "1.0.2"
[com.github.jmnarloch/hstreams43 "1.0.2"]

Dependencies

compile (1)

Group / Artifact Type Version
org.hibernate : hibernate-core Optional jar 4.3.10.Final

test (4)

Group / Artifact Type Version
org.mockito : mockito-all jar 1.10.19
junit : junit jar 4.12
org.hibernate : hibernate-testing jar 4.3.10.Final
com.h2database : h2 jar 1.3.176

Project Modules

There are no modules declared in this project.

Hibernate Streams

A JDK 8 wrapper on top of Hibernate Query API

Build Status

Features

  • Retrieval of Optional query results
  • Query to stream conversion
  • Typed queries

Current compatibility: Hibernate 4.3.x / Hibernate 5.x

See the document that summarizes the introduced API changes

Setup

In order to start and running simply add the artifact to your Maven/Gradle build.

<dependency>
    <groupId>com.github.jmnarloch</groupId>
    <artifactId>hstreams43</artifactId>
    <version>1.0.2</version>
</dependency>

Example

SessionFactory originalFactory = ...;

StreamSessionFactory factory = Streams.wrap(originalFactory);
StreamSession session = factory.getCurrentSession();

long count = session.createQuery("from User")
        .stream()
        .count();

Optional<User> admin = session.createTypedQuery("from User where id = :id", User.class)
        .setParameter("id", 1l)
        .stream()
        .findFirst();

Optional<User> user = session.getOptional("User", 1l);

Todo

  • LocalDate and LocalTime support - will be natively supported through Hibernate 5
  • Optional<?> custom type handler/converter

Versions

Version
1.0.2
1.0.1
1.0.0