Friday, May 24, 2013

Basic commands of Mercurial

These commands are very much to the subversion.

1. Creating a repository (hg init)

 Create a mercurial repository in an empty directory by using the init command:
[root@localhost ~]# mkdir Test
[root@localhost ~]# cd Test
[root@localhost Test]# hg init
[root@localhost Test]# ls -lar
total 12
drwxr-xr-x. 3 root root 4096 May 21 06:42 .hg
dr-xr-x---. 36 root root 4096 May 21 06:40 ..
drwxr-xr-x. 3 root root 4096 May 21 06:42 .

Now there is an empty repository created, locally in your directory. The repository contains both a
working copy, and the repository data (the history information).

2. Adding a file (hg add)

Schedule a file for addition
[root@localhost Test]# echo "Testing1" >>test.txt
[root@localhost Test]# ls -lar
total 16
-rw-r--r--. 1 root root 9 May 21 06:47 test.txt
drwxr-xr-x. 3 root root 4096 May 21 06:42 .hg
dr-xr-x---. 36 root root 4096 May 21 06:40 ..
drwxr-xr-x. 3 root root 4096 May 21 06:47 .
[root@localhost Test]# hg add
adding test.txt

3. Committing a file (hg commit)

Commit command is used to save your changes in the current repository.
[root@localhost Test]# hg commit -m "my first commit"

4. Inspecting History (hg log)

Log command is used to see all changes in your repository.
[root@localhost Test]# hg log
changeset: 0:1b9e0c6235b3
tag: tip
user: abdul waheed abdulwaheed18@gmail.com
date: Tue May 21 06:49:51 2013 -0700
summary: my first commit

We can aslo look at parts of the history by specify revision ranges:
[root@localhost Test]# hg log -r 1
changeset: 1:c5ed72928a5e
tag: tip
user: abdul waheed abdulwaheed18@gmail.com
date: Tue May 21 06:59:28 2013 -0700
summary: second commit
[root@localhost Test]# hg log -r 1:2 # From 1 to 2
[root@localhost Test]# hg log -r :1 # Up to, and including 1.
[root@localhost Test]# hg log -r 2: # From, and including 2

5. Status (hg status)

Status command is used to tells us about modified, removed, or renamed files.
[root@localhost Test]# echo "testing2" >>test2.txt # creating new file
[root@localhost Test]# hg status # test2 is unknown to hg
? test2.txt
[root@localhost Test]# hg add # Adding test2 to hg
adding test2.txt
[root@localhost Test]# hg status #test2 is not yet committed.
A test2.txt

6. Remove Command (hg rm)

Remove command is used to remove the file.
[root@localhost Test]# hg rm test.txt
[root@localhost Test]# hg status
R test.txt
[root@localhost Test]# hg commit -m "removing test.txt file"
[root@localhost Test]# hg log
changeset: 2:689cfc786a1c
tag: tip
user: abdul waheed abdulwaheed18@gmail.com
date: Tue May 21 22:35:30 2013 -0700
summary: removing test.txt file
changeset: 1:c5ed72928a5e
user: abdul waheed abdulwaheed18@gmail.com
date: Tue May 21 06:59:28 2013 -0700
summary: second commit
changeset: 0:1b9e0c6235b3
user: abdul waheed abdulwaheed18@gmail.com
date: Tue May 21 06:49:51 2013 -0700
summary: my first commit

7. Update (hg update)

To check where we are right now ? Use the identity command to check :
[root@localhost Test]# hg identify -n
2

Use update command to update the repository :

[root@localhost Test]# hg update # repository is upto date
0 files updated, 0 files merged, 0 files removed, 0 files unresolved

To update at some specific revision use '-r'

[root@localhost Test]# hg update -r 1
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
[root@localhost Test]# ls
test2.txt test.txt

8. Tag Command (hg tag)

Tag command is used to assign your own symbolic names to specific revisions.
[root@localhost Test]# hg tags
tip 2:689cfc786a1c

[root@localhost Test]# hg log
changeset: 2:689cfc786a1c
tag: tip
user: abdul waheed abdulwaheed18@gmail.com
date: Tue May 21 22:35:30 2013 -0700
summary: removing test.txt file
changeset: 1:c5ed72928a5e
user: abdul waheed abdulwaheed18@gmail.com
date: Tue May 21 06:59:28 2013 -0700
summary: second commit
changeset: 0:1b9e0c6235b3
user: abdul waheed abdulwaheed18@gmail.com
date: Tue May 21 06:49:51 2013 -0700
summary: my first commit

[root@localhost Test]# hg tag -r 1 adding-tag-to-r1 # Adding tag at revision 1

[root@localhost Test]# hg log
changeset: 3:ccb2abafd599
tag: tip
user: abdul waheed abdulwaheed18@gmail.com
date: Tue May 21 22:48:34 2013 -0700
summary: Added tag adding-tag-to-r1 for changeset c5ed72928a5e
changeset: 2:689cfc786a1c
user: abdul waheed abdulwaheed18@gmail.com
date: Tue May 21 22:35:30 2013 -0700
summary: removing test.txt file
changeset: 1:c5ed72928a5e
tag: adding-tag-to-r1 #tag added to revision 1
user: abdul waheed abdulwaheed18@gmail.com
date: Tue May 21 06:59:28 2013 -0700
summary: second commit
changeset: 0:1b9e0c6235b3
user: abdul waheed abdulwaheed18@gmail.com
date: Tue May 21 06:49:51 2013 -0700
summary: my first commit

9. Diff command (hg diff)

Diff command will show difference between the working and repository revision.
[root@localhost Test]# ls
test2.txt
[root@localhost Test]# vi test2.txt
[root@localhost Test]# hg diff # showing diff for file test2.txt
diff -r 689cfc786a1c test2.txt
--- a/test2.txt Tue May 21 22:35:30 2013 -0700
+++ b/test2.txt Tue May 21 22:52:54 2013 -0700
@@ -1,1 +1,2 @@
testing2
+Adding one more line to check diff

10. Pull command (hg pull)

Pull command is used to get all changes from another repository into the current one.
[root@localhost Test]# hg pull https://bitbucket.org/abdulwaheed18/testing

11. Push Command (hg push)

Push command is used to send all changes from your repository to another one.
[root@localhost Test]# hg push https://bitbucket.org/abdulwaheed18/testing

12. Clone Command (hg clone)

Clone command is used to makes a clone of a repository with the complete project history. It makes a complete copy of another repository so that we will have our own local, private one to work in.
[root@localhost test_clone]# hg clone https://bitbucket.org/abdulwaheed18/testing # garbbing testing
warning: bitbucket.org certificate with fingerprint 24:9c:45:8b:9c:aa:ba:55:4e:01:6d:58:ff:e4:28:7d:2a:14:ae:3b not verified (check hostfingerprints or web.cacerts config setting)
http authorization required
realm: Bitbucket.org HTTP
user: abdulwaheed18
password:
warning: bitbucket.org certificate with fingerprint 24:9c:45:8b:9c:aa:ba:55:4e:01:6d:58:ff:e4:28:7d:2a:14:ae:3b not verified (check hostfingerprints or web.cacerts config setting)
destination directory: testing
warning: bitbucket.org certificate with fingerprint 24:9c:45:8b:9c:aa:ba:55:4e:01:6d:58:ff:e4:28:7d:2a:14:ae:3b not verified (check hostfingerprints or web.cacerts config setting)
requesting all changes
warning: bitbucket.org certificate with fingerprint 24:9c:45:8b:9c:aa:ba:55:4e:01:6d:58:ff:e4:28:7d:2a:14:ae:3b not verified (check hostfingerprints or web.cacerts config setting)
adding changesets
adding manifests
adding file changes
added 2 changesets with 2 changes to 2 files
warning: bitbucket.org certificate with fingerprint 24:9c:45:8b:9c:aa:ba:55:4e:01:6d:58:ff:e4:28:7d:2a:14:ae:3b not verified (check hostfingerprints or web.cacerts config setting)
warning: bitbucket.org certificate with fingerprint 24:9c:45:8b:9c:aa:ba:55:4e:01:6d:58:ff:e4:28:7d:2a:14:ae:3b not verified (check hostfingerprints or web.cacerts config setting)
updating to branch default
2 files updated, 0 files merged, 0 files removed, 0 files unresolved

[root@localhost test_clone]# ls # we got local copy of testing
testing

[root@localhost testing]# hg log # local copy with the history
changeset: 1:07c9802fabde
tag: tip
user: abdulwaheed18@gmail.com
date: Tue May 21 02:35:52 2013 -0700
summary: commiting second tym
changeset: 0:7aafa4bde466
user: abdulwaheed18@gmail.com
date: Tue May 21 02:00:18 2013 -0700
summary: test

[root@localhost testing]# hg summary # gives the repository information
parent: 1:07c9802fabde tip
commiting second tym
branch: default
commit: (clean)
update: (current)

13. Help Command (hg help)

Last but not least, Help command will give you the detail explanation of all commands supported by Mercurial.
hg help” will give list of all command.
To check particular command use “hg help <command_name>




Installation and configuration of Mercurial

Installation

Windows :

The best version of Mercurial for Windows is TortoiseHg, which can be found at http://tortoisehg.bitbucket.org/ . This package has no external dependencies. It “just works.” It provides both command-line and graphical user interfaces.
After installation, you will have a right-click menu in Windows Explorer that gives you access to the graphical tools. After logging out and in again, you will also have a hg and a thg program available in a Command Prompt. You can use the thg program to start the graphical TortoiseHg tools.

Command-line : (figure 1)



GUI : (figure2)


Linux :

You can install Mercurial on Linux using package manager -
yum install *mercurial*
but installing it from package manager not assure you the latest version of mercurial.
So, You can install the latest version(2.6) from source http://mercurial.selenic.com/release , unpack it and run make install to install it.
If you get any issue like “error: command 'gcc' failed with exit status 1 ” then install following thing

            yum install python

Check the correct version of devel and install it :

           yum search python | grep -i devel
           yum install python-devel.x86_64
           yum install python-docutils

To find out whether the Mercurial is installed properly. Check hg version command. If the Mercurial is installed properly, You can see the version information as below (figure 3) :


Configuration

Once your setup is ready, You have to add username in the configuration file.

Linux :

create new file having name “.hgrc” under $HOME directory and
[ui]
username =Firstname Lastname <example@example.org>

(Figure 4)


Windows:

create new file having name “Mercurial.ini” under $HOME directory and add
[ui]
username =Firstname Lastname <example@example.org>

To confirm, You have added username correctly, Run hg debuginstall command. You will get the message “No problem detected.”

What is Mercurial ?

Mercurial is a fast, lightweight Source Control Management system designed for efficient handling of very large distributed projects. It is mainly implemented using the Python programming language. It is supported on Windows and Unix-like systems, such as Mac OS X and Linux.

All of Mercurial's operations are invoked as arguments to its driver program hg, a reference to the chemical symbol of the element mercury.

Mercurial's major design goals include high performance and scalability, decentralized, fully distributed collaborative development, robust handling of both plain text and binary files, and advanced branching and merging capabilities, while remaining conceptually simple. 


How you can benefit from Mercurial

  1. It is fast and powerful, It efficiently handles projects of any size and kind. Every clone contains the whole project history, so most actions are local, fast and convenient.
  2. Mercurial supports a multitude of workflows and you can easily enhance its functionality with extensions.
  3. It is easy to learn and use
  4. It is lightweight.
  5. It scales excellently.

How to read certificates using CertificateFactory class

In my previous blog, I have explained how can you create self signed certificate using bouncy castle API and how to import it into keystore.

This tutorial will explain how to read existing certificate file using java.security.cert.CertificateFactory class.


import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.security.KeyStore;
import java.security.PublicKey;
import java.security.cert.Certificate;
import java.security.cert.CertificateFactory;

/**
 * Reads the certificate and import into Java keystore.
 *
 * @author abdul
 *
 */
public class ReadCertificateFile {

    /**
     * @param args
     * @throws Exception
     */
    public static void main(String[] args) throws Exception {

        ReadCertificateFile readCertificateFile = new ReadCertificateFile();

        // Path of the certificate file
        FileInputStream fis = new FileInputStream("YOUR_CERTIFICATE.cert");

        /*
         * Returns a CertificateFactory object of the specified certificate
         * type.
         */
        CertificateFactory cf = CertificateFactory.getInstance("X.509");
       
        /*
         * Read the certificate from the specified input stream, and returns it
         * as a Certificate object. It can read certificate in both binary (DER
         * encoded) and printable (RFC standard) formats.
         */
        java.security.cert.Certificate cert = cf.generateCertificate(fis);

        System.out.println();
        System.out.println("Certificate Details: ");
        /*Returns the type of this certificate factory*/
        System.out.println("Type = " + cert.getType());
       
        System.out.println("toString = " + cert.toString());

        PublicKey key = cert.getPublicKey();
        System.out.println();
        System.out.println("PublicKey Object Info: ");
        System.out.println("Algorithm = " + key.getAlgorithm());
        System.out.println("Format = " + key.getFormat());
        System.out.println("toString = " + key.toString());

        // save/import certificate into keystore
        readCertificateFile.saveCert(cert);
    }

    private void saveCert(Certificate cert) throws Exception {
        KeyStore keyStore = KeyStore.getInstance("JKS");
        keyStore.load(null, null);

        // import your certificate into keystore
        keyStore.setCertificateEntry("YOUR_ALIAS_NAME", cert);

        // name of keystore "
        File file = new File(".", "YOUR_KEYSTORE_NAME");
        keyStore.store(new FileOutputStream(file),
                "YOUR_PASSWORD".toCharArray());
    }

}


Tuesday, April 9, 2013

Eclipse - Tips & Tricks

This article is for those who use Eclipse. Keyboards shortcuts are very important for comfortable and quick editing. Here are the list of most important shortcuts in Eclipse :
For a full list of shortcuts, you can also check by pressing Ctrl+Shift+L.
  1. Ctrl +3 Focus into the Quick Access search box which allows you to execute any Eclipse command.
  2. Ctrl+SHIFT+T Search dialog for Java Type, Start typing the name and the list gets smaller. Try typing the capital letters of the class only (e.g. type "NPE" to find "NullPointerException")
  3. Ctrl+SHIFT+R Search dialog for resources, e.g. Xml files, text files, or files of any other type.
  4. Ctrl+E Open Editor Drop down, Presents a popup window listing currently opened files.
  5. Ctrl+O Quick Outline, Show all methods of the current class, Press Ctrl+O a second time to include inherited methods.
  6. Ctrl+SHIFT+space Context Information
  7. Ctrl+Shift+O Organize Imports, Adjusts the imports statements in the current Java source file
  8. F3 Open Declaration ,Navigate to the declaration of the selected variable . This works much like a browser hyperlink.
  9. Ctrl + hover to methods,variables Ask for Open Declaration, Implementation, Super Implementation or return types.
  10. Alt+Left/Right Backward/Forward History, Works like a browser's back/forward button.
  11. Ctrl + L Go to a specific line number.
  12. F4 Open Type Hierarachy
  13. Ctrl+Alt+H Open Call Hierarchy. Show where a method is called from.
  14. Alt + SHIFT + R Use this to rename type, method, or field. All existing references will be refactored as well.
  15. Alt+Shift+M Extract method, Use this to extract a new method from existing code. The parameter list and return type will be automatically created.
  16. Ctrl+Shift+P Go to the matching bracket.
  17. SHIFT+ENTER /Ctrl+SHIFT+ENTER Insert a line below or above the current line.
  18. Ctrl + /, Ctrl+7, Ctrl +\ Add or Remove block comment.
  19. Ctrl +F6 Switch among the editor.
  20. Ctrl + F7 Switch among open views.
  21. Ctrl + F8 Switch among perspectives.
  22. Alt +/ It does the word completion based on the set of words already present in the current file.
  23. Ctrl + I It correct the indention for block of Java code or an entire class.
  24. Ctrl + . or Ctrl + , It will navigate to next or previous error.
  25. Ctrl+F11, F11, Run or Debug the Application.
  26. F5,F6, F7, F8 Step into function, Next Step (line by line) , Step out , Skip to next breakpoint.
  27. Ctrl +1 Give quick fix code.
  28. Ctrl + D Delete the current line.
  29. Ctrl + SHIFT + G Search for current cursor positioned word reference in workspace.
  30. Ctrl +Page Up/Page Down Switch to next editor / switch to previous editor
  31. Alt + - Open Editor Window Option menu.
  32. Ctrl +F10, then n It will show or hide the line numbers
  33. Ctrl + q It will jump to last location edited
  34. Ctrl + SHIFT + f It will format all code in Editor using code formatter.
  35. Alt + SHIFT + J or /** and then press Enter Add javadoc Element Comment ( adds '/** ... */')
  36. Alt + SHIFT + V Move selected element to other class or file (With complete method or class selected)
  37. Ctrl + DEL Delete next element
  38. Ctrl + BACKSPACE Delete previous element. 
    Note : I have not added basic shortcut like Ctrl+S to save the file.
    Feel free to comment If you find something is incorrect or update me more :)

Wednesday, April 3, 2013

Hibernate Configuration

To inform Hibernate from where to find mapping information of Java classes to database tables or configuration setting related to database, All such information is usually supplied by Hibernate Configuration Object. It is managed by an instance of org.hibernate.cfg.Configuration. An instance of org.hibernate.cfg.Configuration represents an entire set of mappings of an application’s Java types to an SQL database. The mappings are compiled from various XML mapping files or from Java 5 Annotations.

Hibernate provides following types of configurations
  1. hibernate.cfg.xml – A standard XML file which contains hibernate configuration and which resides in root of application’s CLASSPATH 
  2. hibernate.properties – A Java compliant property file which holds key value pair for different hibernate configuration strings. 
  3. Programmatic configuration – This is the manual approach. The configuration can be defined in Java class. 

1. hibernate.cfg.xml : The hibernate.cfg.xml file is a standard XML file which contains all the configuration parameters like database connection, class mappings etc. This file needs to be placed root of CLASSPATH of application.

Below is the sample hibernate.cfg.xml file :
 
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration> <session-factory>
<!-- Database connection settings -->
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="connection.url">jdbc:mysql://localhost/SampleApp</property>
<property name="connection.username">root</property>
<property name="connection.password">root123</property>
<!-- JDBC connection pool (use the built-in) -->
<property name="connection.pool_size">1</property>
<!-- SQL dialect -->
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<!-- Enable Hibernate's automatic session context management -->
<property name="current_session_context_class">thread</property>
<!-- Disable the second-level cache -->
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
<!-- Echo all executed SQL to stdout -->
<property name="show_sql">false</property>
<!-- Drop and re-create the database schema on startup -->
<property name="hbm2ddl.auto">update</property>
<!-- Mapping files POJO -->
<mapping class="com.hibernate.pojo.Host"/>
</session-factory>
</hibernate-configuration>

2. hibernate.properties file :
This is the easiest way to get started with Hibernate. Create a file hibernate.properties and place it in root of your applications CLASSPATH.
 
Below is the sample hibernate.properties file:

hibernate.connection.driver_class=com.mysql.jdbc.Driver
hibernate.connection.url=jdbc:mysql://localhost/SampleApp
hibernate.connection.username=root
hibernate.connection.password=root123
hibernate.connection.pool_size=1
hibernate.dialect = org.hibernate.dialect.MySQLDialect
 3. Programmatic Configuration

We can obtain a org.hibernate.cfg.Configuration instance by instantiating it directly and specifying XML mapping documents. If the mapping files are in the classpath, use addResource(). For example:
Configuration cfg = new Configuration()
.addResource("Host.hbm.xml");

An alternative way is to specify the mapped class and allow Hibernate to find the mapping document for you:
Configuration cfg = new Configuration()
.addClass(com.hibernate.pojo.Host.class);

A org.hibernate.cfg.Configuration also allows you to specify configuration properties. For example:
 Configuration cfg = new Configuration()
.addClass(com.hibernate.pojo.Host.class)
.setProperty("hibernate.dialect", "org.hibernate.dialect.MySQLDialect")
.setProperty("hibernate.connection.datasource", "jdbc:mysql://localhost/SampleApp")
.setProperty("hibernate.order_updates", "true");

Refer here for more details :
http://docs.jboss.org/hibernate/core/3.6/reference/en-US/html/session-configuration.html#configuration-optional 

Tuesday, April 2, 2013

What is Hibernate ?

What is Hibernate ?
  1. Hibernate is an  open source java based library used to work with relational databases. 
  2. The term Object/Relational Mapping refers to the programming technique for converting data between relational databases and object oriented programming languages such as Java, C# etc.
  3. It is a very powerful ORM solution build on top of JDBC API.
  4. It was initiated by Gavin King in 2001.
  5. It is a persistence framework which is used to store and retrieve data from database. It is a powerful, high performance Object-Relational Persistence and Query service for any Java Application
  6. Hibernate  makes use of persistent objects called POJOs (Plain Old Java Objects).
  7. Hibernate maps Java classes(POJO) to database tables and from Java data types to SQL data types and relieve the developer from 95% of common data persistence related programming tasks.
  8. These objects works as a data carrier called DTO (Data Transfer Object). They are used to carry data between different layers.


Hibernate Position

Advantages of Hibernate :

  1. Hibernate takes care of mapping Java classes to database tables using annotation or XML files. You don't need to write any code to map it.
  2.  It provides simple APIs for storing and fetching Java objects directly to and from the database.
  3. If there is change in database or in any table then the only need to change XML file properties. and Java classes which are related to the table.
  4. No need of SQL knowledge, you just need to work on familiar Java data types.
  5. It does not require an application server to operate.
  6.  Reduce database access complexity by easy fetching techniques.
  7. It has easy and simple query for data access.
  8. It is layers architecture and you can use the components as per your application need.
  9. Hibernate is database independent and you can use any database of your choice. It supports all major RDBMS like HSQL Database Engine, DB2/NT, MYSQL, PostgreSQL, FrontBase, Oracle, Microsoft SQL Server, Database,  Sybase SQL Server,  Informix Dynamic Server.
  10. It also provide caching framework that works with Hibernate. You can use any one in your application to improve the performance of your application.

 Hibernate Architecture :

The figure given below represents the architecture of Hibernate :

 

Hibernate framework uses various existing Java APIs, like JDBC, Java Transaction API(JTA), and Java Naming and Directory Interface (JNDI). JDBC provides a rudimentary level of abstraction of functionality common to relational databases, allowing almost any database with a JDBC driver to be supported by Hibernate. JNDI and JTA allow Hibernate to be integrated with J2EE application servers.

Below are some definitions of the object depicts in above diagram :
  • Persistent Object : These are short-lived, single threaded objects containing persistent state and business function. These can be ordinary JavaBeans/POJOs. They are associated with exactly one Session. Once the Session is closed, they will be detached and free to be used in any application layer (for example, directly as data transfer objects to and from presentation).
  • Transient Object : Instances of persistent classes those are not currently associated with a Session. They may have been instantiated by the application and not yet persisted, or they may have been instantiated by a closed Session.
  • Configuration (org.hibernate.cfg.Configuration ): The configuration of Hibernate is handled by the instance of org.hibernate.cfg.Configuration . It is the first Hibernate object you create in any Hibernate application and usually created only once during application initialization. It represents a configuration or properties file required by the Hibernate.
    Configuration cfg = new Configuration()
  • SessionFactory (org.hibernate.SessionFactory ) : Session factory is a thread safe, immutable cache of compiled mappings for a single database. Configuration object is used to create a SessionFactory object. Only single instance of session factory is required for an application, so it is based on a singleton pattern. Typically SessionFactory is require for per database using a separate configuration file. So in case If you are using multiple databases then you would have to create multiple SessionFactory objects. The SessionFactory is heavyweight object so usually it is loaded at the start of the application.
    SessionFactory sessions = cfg.buildSessionFactory();
  • Session (org.hibernate.Session): The session object provides an interface between the application and data stored in the database. It is a lightweight object and it wraps JDBC connection. It is factory of Transaction, Query and Criteria. It holds a mandatory (first-level) cache of persistent objects, used when navigating the object graph or looking up objects by identifier.
    Session session = sessions.openSession(); 
  • Transaction (org.hibernate.Transaction): It is a single-threaded, short-lived object used by the application to 
    specify atomic units of work. It is Optional. It provides methods for transaction management.  
  • Query :  Query object use Hibernate Query Language(HQL) or SQL to fetch data from the database. 
  • Criteria : Criteria object are used to create and execute object oriented criteria queries to retrieve objects. 


How TOPT Works: Generating OTPs Without Internet Connection

Introduction Have you ever wondered how authentication apps like RSA Authenticator generate One-Time Passwords (OTPs) without requiring an i...