Author: Editorial Team
-
Spring @Bean annotation
1. Introduction In this tutorial, we’ll discuss @Bean annotation which is a very important annotation to know. A Java object instance managed by Spring container is called bean. This annotation is typically used to define methods to create beans. You can use the @Bean annotation in a @Configuration-annotated or in a @Component-annotated class. A method annotated with @Bean registers…
-
JPA @Embedded And @Embeddable
1. Introduction In this tutorial, we’ll discuss embeddable types in JPA. An embeddable type is a composition of values. If you have a class which naturally is a part of another class then this class can be made embedded. For example, consider a class Address, which has properties Country, State and City. This Address class…
-
Hibernate Entity LifeCycle
1. Introduction In this tutorial, we’ll discuss life cycle of persistent objects in Hibernate. In a Hibernate application, there can be two types of objects: An entity object which is mapped to the table and has properties mapped to the tables. Objects which are not directly recognized by the Hibernate. Hibernate can work with both…
-
Pure and impure Pipe in Angular
1. Introduction In this tutorial, we’ll discuss pure and impure pipe in Angular. Understanding pure and impure pipe is very important to writing efficient Pipes and efficient application. By default, pipe are defined as pure in Angular which means Angular executes the pipe only when it detects a pure change to the input value. In…
-
Configure custom DataSource in Spring Boot
1. Introduction If spring-boot-starter-data-jpa dependency is used, Spring will try to configure the DataSource. You just have to provide the connection details in the property file to get started. However, if you have requirement to create your own DataSource, Spring allows you to do that. In this tutorial, we’ll discuss how to configure custom DataSource…
-
Second-level cache in Hibernate
1. Introduction In this tutorial, we’ll discuss second-level (or L2) cache in Hibernate. The persistence context is also called the first-level cache, and it’s enabled by default. But sometimes we may require to have cache data outside the context of a particular Session. The second-level cache is answer to this requirement. A second-level cache is…
-
An introduction to caching in Hibernate
1. Introduction Accessing a database is an expensive operation even if it is a simple query. The request is sent to the server over the network. The database server then compiles the SQL into a query plan. The query plan is executed and returned back to the client over the network. This complete flow may…
-
@Controller and @RestController annotation in Spring
1. Introduction In this tutorial, we’ll discuss the difference between @Controller and @RestController annotations in Spring MVC. The @Controller annotation is available since Spring 2.5 whereas @RestController was introduced in Spring 4.0 to simplify creation of RESTful web services. 2. @Controller annotation This annotation is a specialization of @Component and indicates that the annotated class…
-
RxJS operators
1. Introduction RxJS is very convenient to use because it provides lot of operators. RxJS operators are very helpful in working with asynchronous data. RxJS operators are actually functions. There are two types of operators: Pipeable Operators Creation operators 2. Pipeable Operators These operators can be piped to Observables. The syntax of pipeable operator is:…
-
Prevent singleton pattern from serialization in Java
1. Introduction Serialization means to convert state of an object into a byte stream. Deserialization is the process of converting the serialized form of an object back into a copy of the object. A Singleton class is supposed to have only one instance. Using deserialization, it is possible to break this pattern. If you deserialize…
