Java Magazine, Nov/Dec 2017
ORACLE COM JAVAMAGAZINE NOVEMBER DECEMBER 2017 52 java ee 8 String poolShape Stream Job jobstream em createQuery select object o from Job o getResultStream return jobstream filter c poolShape equals c getCustomerId getPoolId getShape collect Collectors toList As I initially mentioned it is important to be aware of performance in scenarios where lots of data is returned There are also circumstances in which streams are beneficial in querying databases and others where they can cause performance degradation A good rule of thumb is that if the data can be queried within the confines of a SQL query it might make most sense to do just that Sometimes the benefits of using the elegant stream syntax do not outweigh better performance that can be gained using standard SQL filtering Repeatable Annotation Support When Java SE 8 was released repeatable annotations became possible letting the same annotation be repeated on a declaration more than once Some situations require the use of the same annotation more than one time on a class or field For instance there might be more than one @ SqlResultSetMapping annotation on a given entity class In situations such as these a container annotation had to be used prior to repeatable annotation support Not only do repeatable annotations reduce the requirement to wrap a collection of the same annotations inside a container annotation but they can also make code easier to read Repeatable annotations became possible letting the same annotation be repeated on a declaration more than once
You must have JavaScript enabled to view digital editions.