Do you want to know how to develop your skillset to become a Java Rockstar?

Subscribe to our newsletter to start Rocking right now!

To get you started we give you our best selling eBooks for FREE!

1. JPA Mini Book

2. JVM Troubleshooting Guide

3. JUnit Tutorial for Unit Testing

4. Java Annotations Tutorial

5. Java Interview Questions

and many more ....

 

Scalable, Robust – and Standard – Java Web Services with Fibers

java-interview-questions-answers

This blog post discusses benchmarking web service performance under load. To learn more about the theory of web service performance, read Little’s Law, Scalability and Fault Tolerance. Benchmarking a Web Service with Blocking and Asynchronous IO How a web application (or a web service) behaves under load, in the face of various failures, and under a combination of the two, is ...

Read More »

Microservice Design Patterns

software-development-2-logo

The main characteristics of a microservices-based application are defined in Microservices, Monoliths, and NoOps.  They are functional decomposition or domain-driven design, well-defined interfaces, explicitly published interface, single responsibility principle, and potentially polyglot. Each service is fully autonomous and full-stack. Thus changing a service implementation has no impact to other services as they communicate using well-defined interfaces. There are several advantages of such an application, but its not ...

Read More »

JPA入门教程 – 终极指南

java-interview-questions-answers

编者按:Java持久化API(JPA)是Java语言中的应用程序编程接口规范,在基于Java平台标准版和Java平台企业版的应用程序中,JPA负责管理关系数据。 JPA已经成为事实上的标准,用于编写与数据库交互的代码。也正由于此,我们已经在Java Code Geeks提供了丰富的教程,可以在这里访问这些教程。此外,我们还制作了一本JPA迷你书,它能够帮助你入门JPA,而且顺利过渡到更高级的概念(加入我们的newsletter,可以免费获取)。 现在,我们想要建立一篇独立的、可做参考的文章:提供一个帮助你了解如何使用JPA的框架;并帮助你快速启动你的JPA应用程序开发。开始享受吧! 目录 1. 简介 2. 创建项目 3. 基础知识 3.1. EntityManager和持久化单元(Persistence Unit) 3.2. 事务(Transactions) 3.3. 数据库表(Tables) 4. 继承(Inheritance) 5. 实体关系(Relationships) 5.1. 一对一(OneToOne) 5.2. 一对多(OneToMany) 5.3. 多对多(ManyToMany) 5.4. Embedded / ElementCollection 6. 数据类型和转换器(Converters) 7. 条件查询(Criteria) API 8. 序列(Sequences) 9. 源码下载 1. 简介 Java持久化API(JPA)是一个独立于供应商的、用于映射Java对象和关系型数据库表的规范。此规范的实现,使得应用程序的开发者们可以不依赖于他们工作中面对的特定数据库产品,从而开发出可以与不同数据库产品良好工作的CRUD(创建、读取、更新、删除)操作代码。这些框架除了可以用于处理与数据库交互的代码(JDBC代码),也可以用于映射数据和应用程序中的对象。 JPA由三个不同的组件构成: 实体(Entities): 在当前版本的JPA中实体是普通Java对象(POJO)。老版本的JPA中实体类需要继承JPA提供的实体基类,但是这样的设计导致框架中存在了严重的依赖关系,测试变得更加困难;所以在新版JPA中不再要求实体类继承任何框架类。 对象-关系型元数据(Object-relational metadata): 应用程序的开发者们必须正确设定Java类和它们的属性与数据库中的表和列的映射关系。有两种设定方式:通过特定的配置文件建立映射;或者使用在新版本中支持的注解。 Java持久化查询语句(Java Persistence Query Language - JPQL): 因为JPA旨在建立不依赖于特定的数据库的抽象层,所以它也提供了一种专有查询语言来代替SQL。 这种由JPQL到SQL语言的转换,为JPA提供了支持不同数据库方言的特性,使得开发者们在实现查询逻辑时不需要考虑特定的数据库类型。 在本教程中,我们会纵览JPA框架的不同方面,同时开发一个简单的、可以从关系数据库中存储和检索数据的Java SE应用程序。我们使用到的类库/环境如下: ...

Read More »

What’s new in Grails 3

grails-logo

A few days ago Grails 3.0 was officially released. Grails is now based on Spring Boot, the build system changed from Gant to Gradle and significant parts of the framework have been rewritten. In this post we will have a look at all the major changes introduced by Grails 3. Updated file structure We will start with a screenshot that ...

Read More »

R: Snakes and ladders markov chain

software-development-2-logo

A few days ago I read a really cool blog post explaining how Markov chains can be used to model the possible state transitions in a game of snakes and ladders, a use of Markov chains I hadn’t even thought of! While the example is very helpful for understanding the concept, my understanding of the code is that it works ...

Read More »

Writing Clean Tests – Small Is Beautiful

software-development-2-logo

We have learned that “clean” unit tests might not be as clean as we think. We have done our best to make our unit tests as clean as possible. Our tests are formatted properly, use domain-specific language, and avoid excessive mocking. Nevertheless, our unit tests are not clean because:           When we make changes to the ...

Read More »

How does Hibernate store second-level cache entries

jboss-hibernate-logo

Introduction The benefit of using a database access abstraction layer is that caching can be implemented transparently, without leaking into the business logic code. Hibernate Persistence Context acts as a transactional write-behind cache, translating entity state transitions into DML statements. The Persistence Context acts as a logical transaction storage, and each Entity instance can have at-most one managed reference. No ...

Read More »

How to FlatMap a JDBC ResultSet with Java 8?

java-interview-questions-answers

You’re not into the functional mood yet? Then the title might not resonate with you – but the article will! Trust me. Essentially, we want this: +------+------+------+ | col1 | col2 | col3 | +------+------+------+ | A | B | C | row 1 | D | E | F | row 2 | G | H | I | ...

Read More »

Scala Snippet: Case Class vs plain ordinary Class

scala-logo

In Scala there exist the construct of a ‘case class’. According to Martin Odersky this supports you to write a “regular, non-encapsulated data structure”. It always seems to be associated with pattern matching. So when to use a case class and when to use a ‘plain’ class? I found this nice explanation stating: “Case classes can be seen as plain ...

Read More »
Want to take your Java Skills to the next level?
Grab our programming books for FREE!
  • Save time by leveraging our field-tested solutions to common problems.
  • The books cover a wide range of topics, from JPA and JUnit, to JMeter and Android.
  • Each book comes as a standalone guide (with source code provided), so that you use it as reference.
Last Step ...

Where should we send the free eBooks?

Good Work!
To download the books, please verify your email address by following the instructions found on the email we just sent you.