Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jmnarloch/hstreams
A JDK 8 wrapper on top of Hibernate Query API
https://github.com/jmnarloch/hstreams
Last synced: 4 days ago
JSON representation
A JDK 8 wrapper on top of Hibernate Query API
- Host: GitHub
- URL: https://github.com/jmnarloch/hstreams
- Owner: jmnarloch
- License: apache-2.0
- Created: 2015-05-14T21:12:50.000Z (over 9 years ago)
- Default Branch: hstreams-43
- Last Pushed: 2015-09-01T19:43:36.000Z (about 9 years ago)
- Last Synced: 2023-07-26T21:59:22.948Z (over 1 year ago)
- Language: Java
- Size: 453 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Hibernate Streams
A JDK 8 wrapper on top of Hibernate Query API
[![Build Status](https://travis-ci.org/jmnarloch/hstreams.svg?branch=hstreams-43)](https://travis-ci.org/jmnarloch/hstreams)
## Features
* Retrieval of Optional query results
* Query to stream conversion
* Typed queriesCurrent compatibility: [Hibernate 4.3.x](https://github.com/jmnarloch/hstreams/tree/hstreams-43) / [Hibernate 5.x](https://github.com/jmnarloch/hstreams/tree/hstreams-5)
See the document that summarizes the introduced [API](api.adoc) changes
## Setup
In order to start and running simply add the artifact to your Maven/Gradle build.
```
com.github.jmnarloch
hstreams43
1.0.2```
## Example
```
SessionFactory originalFactory = ...;StreamSessionFactory factory = Streams.wrap(originalFactory);
StreamSession session = factory.getCurrentSession();long count = session.createQuery("from User")
.stream()
.count();Optional admin = session.createTypedQuery("from User where id = :id", User.class)
.setParameter("id", 1l)
.stream()
.findFirst();Optional user = session.getOptional("User", 1l);
```## Todo
* LocalDate and LocalTime support - will be natively supported through Hibernate 5
* Optional> custom type handler/converter