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 ....



Scala Snippet: Object, Companion Object and Static Methods

If you are a Java developer moving to Scala, one notable difference in terminology that can cause confusion is the term ‘object’. In Java an object is always an instance of a class, created by calling a constructor. Object In Scala an object is used for defining a single instance of a class with the features you want. In practice ...

Read More »

Meta-cycles in technology choices

I’ve been working on my keynote for QCon Beijing and looking at technology trends and choices since the 1950s. One of the interesting tensions that I’ve seen in IT is the tensions between “getting it right” and “doing it quick”. Most of enterprise/business IT is about making good business decisions. Business people who make those decisions need information that’s mostly ...

Read More »

Farewell to Asynchronous Code


Quasar is a library that adds true lightweight threads (fibers) to the JVM. These are very cheap and very fast – in fact, fibers behave just like Erlang processes or Go goroutines – and allow you to write simple blocking code while enjoying the same performance benefits of complex asynchronous code. In this post we’ll learn how to transform any asynchronous, ...

Read More »

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


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

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持久化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

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

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 »

Want to take your Java skills to the next level?

Grab our programming books for FREE!

Here are some of the eBooks you will get:

  • Spring Interview QnA
  • Multithreading & Concurrency QnA
  • JPA Minibook
  • JVM Troubleshooting Guide
  • Advanced Java
  • Java Interview QnA
  • Java Design Patterns