Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Java Holiday Calendar 2016 (Day 5): CRUD Operations

DZone's Guide to

Java Holiday Calendar 2016 (Day 5): CRUD Operations

See how, with a handy open-source tool, you can alter your database entities, with standard CRUD operations, in Java.

· Java Zone
Free Resource

Just released, a free O’Reilly book on Reactive Microsystems: The Evolution of Microservices at Scale. Brought to you in partnership with Lightbend.


Today’s tip is an introduction on how to use open-source Speedment to expand Java 8's Streams to support Creating, Reading, Updating and Deleting database entities.

Head out to Speedment's GitHub page to see how to modify your project's POM file. Once you've made the changes, you can connect to an existing database and generate Java code automatically from the database's meta information (like columns and tables). Once completed, your Java Streams becomes much more feature-full, and you can:

Do This

hares.stream()
  .filter(Hare.NAME.equal("Harry"))
  .map(Hare.COLOR.setTo("Brown"))
  .forEach(hares.updater()); 

  // Sets the color to "Brown" for all hares named "Harry" in the DB


Follow the Java Holiday Calendar 2016 with small tips and tricks all the way through the winter holiday season.

Strategies and techniques for building scalable and resilient microservices to refactor a monolithic application step-by-step, a free O'Reilly book. Brought to you in partnership with Lightbend.

Topics:
java ,crud ,streams ,speedment

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}