Hibernate or JPA support 4 different types of primary key generator. These generators are used to generate primary key while inserting rows in the database. Below are the primary key generator −GenerationType.AUTOGenerationType. IDENTITYGenerationType.SEQUENCE GenerationType.TABLEGenerationType. IDENTITY − In identity , database is responsible to auto generate the primary key. Insert a row without specifying a value for the ID and after inserting the row, ask the database for the last generated ID. Oracle 11g does not support identity key generator. This feature is supported in Oracle 12c. GenerationType. SEQUENCE − In sequence, we first ask database for the next set of the sequence ... Read More
Collection.stream().forEach() and Collection.forEach() both are used to iterate over collection. Collection.forEach() uses the collection’s iterator. Most of the collections doesn’t allow the structurally modification while iterating over them. If any element add or remove while iteration they will immediately throw concurrent modification exception. If Collection.forEach() is iterating over the synchronized collection then they will lock the segment of the collection and hold it across all the calls. Collection.stream().forEach() is also used for iterating the collection but it first convert the collection to the stream and then iterate over the stream of the collection therefore the processing order is undefined. It also throws ... Read More
Many people love summers but most hate the heat. Therefore, air conditioners have been one of the most favourite electrical appliances in the dog days of summer. Nonetheless, air conditioners consume enough electricity and manufacturers have been fiercely fighting to diminish the electricity consumption of air conditioners.If you notice carefully, you’d find many air conditioner advertisements that focus on low electricity consumption. It is important because saving energy is not only important for environmental sustainability, but electrical appliances also need to be light on the pocket.Now, if we say air conditioners can run without electricity too, will you be impressed? ... Read More
In this article, we will learn how to change or relocate the PostgreSQL Database data directory to the new location on Ubuntu 16.04. This database grows more frequently and depends upon the size of the company, as we needed more space and for security reasons we will change the data directory to the other volume or other location.PrerequisitesAn Ubuntu machine with a non-root user with Sudo permission.A PostgreSQL server installed and working.A new volume or location where we want to move the database data location, the new location will be /mnt/data_vol/PostgreSQL as the data_vol is the new volume attached to ... Read More
In a world where big-screen devices are all the craze, how about getting a camera that comfortably fits one’s palms, and yet manages to click pictures large enough to give even the widest screens in the world a run for their money? Yes, you guessed it right! We are talking of 360-degree cameras that- as per their names- can take a 360-degree view snapshot.Ricoh Theta- $399The feature about Ricoh Theta that immediately arrests your attention has, interestingly, got to do with not the specifications but the price. Keeping in mind what this camera can do, it comes at a jaw-dropping ... Read More
In this article, we will learn how to change the Apache default web root folder to a new location. By default, the Apache web root or Document root folder location is at /var/www/html.These type of changes will be useful for security reason or having the space issue due to data size, we want to change the document root folder to another location or mount point. This will be helpful if we have multiple instances and we want to keep the data for each website into their own volumes or folders.PrerequisitesAn Ubuntu 16.04 server with a user with Sudo permissions on ... Read More
Do you like to be at the center stage when the management showers the praises and appreciates with thundering applause? Of course, those are the golden moments that everyone is dreaming about. But, is it easy to be a champion without adequate knowledge and skills? No, not at all. You should have all the required skills to excel.And when we talk about a role like Scrum Master, which is widely misunderstood and misinterpreted in many organizations, how come, a person effectively play the role and it’s responsibilities and becomes a champion scrum master, isn’t it challenging?Let’s discuss how you can ... Read More
To provide energy for nearly 7.2 billion people on earth itself is a huge task, and most of the energy needs today is met through the use of fossil fuels. The International energy agency estimated that in 2012, the world energy consumption was 13, 371 Mtoe , or 5.6 × 1020 joules. Oil is still the primary source of energy. However, during the period of 2000–2012, coal was the source of energy with the largest growth in terms of usage. The use of other fossil fuels and electricity followed that trend.We can see the disadvantages of using too much fossil ... Read More
Spyware is an unwanted program that gets installed in user’s system without his/her permission and tracks all the activities like important log-in information, valuable data, internet interactions etc. In addition to that, it hampers the performance of systems and even redirects web browser searches.Its rank on vulnerability is high because detection is very difficult. Before some spyware will be installed on your system, you have to open or click on some programs. The usual sources of these are spam folders of your mail, free downloaded software, misleading pop-ups and corrupt websites. Unless you are not sharp enough to judge these ... Read More
Serialization is the process of converting object to stream byte and storing byte stream in database or memory. Class which implements java.io.Serializable interface can be serialized. Class which is implementing this interface gives the responsibility to JVM for serialize or persist java object As per the oracle docs −readObject method − Each subclass of a serializable object may define its own readObject method. If a class does not implement the method, the default serialization provided by defaultReadObject will be used. When implemented, the class is only responsible for restoring its own fields, not those of its supertypes or subtypes.The readObject method of ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP