Fetching strategies in Hibernate

Hibernate uses a fetching strategy to retrieve associated objects if the application needs to navigate the association. Fetch strategies can be declared in the O/R mapping metadata, or over-ridden by a particular HQL or Criteria query. Hibernate3 defines the following fetching strategies: Join fetching: Hibernate retrieves the associated instance or…

Continue reading

Joins In Hibernate

Hibernate supports 4 types of joins.. Left Join Right  Join Full Join Inner Join the DEFAULT join in hibernate is Inner join Similar posts: Hibernate Architecture Hibernate Using Mapping File Inheritance Mapping In Hibernate Inheritance-Table Per Class Hierarchy Hibernate-generator-element

Continue reading

Microservices

What Are Microservices? Microservices are a form of service-oriented architecture style (one of the most important skills for Java developers) wherein applications are built as a collection of different smaller services rather than one whole app. Instead of a monolithic app, you have several independent applications that can run on…

Continue reading

Default Method

Need for default method- Without effecting implementation classes if we want to add new method to the interface then we can do this with default interface. Syntax:

Output: Default Method Suppose if we want to provide new implementation then we can do this as well. This can be done as…

Continue reading

Lamda_SquareExample

Lamda Expression example for square of int :

Output: Square of 2 is :4 now suppose we put parenthesis in the body as below and try to compile the code using command prompt,

you will get compilation error as below: \basic>javac Lamda_SquareExample.java Lamda_SquareExample.java:13: error: not a statement Interfun…

Continue reading

Lamda_AddExample

Example of Lamda Expression for addition of two int.

Output: Sum is:30 Sum is:300 Similar posts: Java 8 Features Functional Interface Lamda Expression

Continue reading

Lamda Expression

Lamda Expression: Ealier for a function few things were mandatory,such as 1>Access Modifier. 2>Return statement. 3>Name Eg:

  But for a Lamda expression these things are not required,so the above function is written as:

  The Operator that is used to denote the lamda expression is -> Now…

Continue reading

Functional Interface

An Interface which has only one abstract method is known as Functional Interface. It can have any number of default and static method but only one abstract method is allowed. @FunctionalInterface is the annotation used to forcefully tell the compiler that the interface is a FunctionalInterface. Sample code: package com.technicalstack.basic;…

Continue reading

Java 8 Features

Some of the important Java 8 features are; Functional Interfaces and Lambda Expressions default and static methods in Interfaces forEach() method in Iterable interface Java Stream API for Bulk Data Operations on Collections Java Time API Collection API improvements Concurrency API improvements Java IO improvements Similar posts: Top Java Questions…

Continue reading

Multithreading Interview Question-1

Question 1. What is Thread in java? Answer. Threads consumes CPU in best possible manner, hence enables multi processing. Multi threading reduces idle time of CPU which improves performance of application. Thread are light weight process. A thread class belongs to java.lang package. We can create multiple threads in java,…

Continue reading