Skip to main content

how to setup/configure hibernate ORM in your spring project

This article is for how to setup/configure hibernate ORM in your spring project.
Add below maven dependency in pom.xml <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-core</artifactId> <version>4.0.1.Final</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-validator</artifactId>

List Interface

List Interface –

            List interface is used for storing element as a sequence.  It means List maintain the sequence according to inserted order. List interface extends the Collection interface. List maintains the index of all elements. So you can insert and retrieve elements by their index.

            Keep in mind that list may contain duplicate elements.

            List interface has its own methods which described below –

void add(int index, Object obj) –
            This method is used for insert element at given position into the List. Element which is already exist on the given index automatically shifted up.

boolean addAll(int index, Collection c) –
            This method adds all the object of Collection c at given index and return true, otherwise return false in case of failure.

 Object get(int index) –
            This method return the element of given index.

int indexOf(Object obj) –
            This method return the inedx of given element.

int lastIndexOf(Object obj) –
            This method is used for return the last index of given element.

 ListIterator listIterator() –
            This method returns the iterator for all elements.

ListIterator listIterator(int index) –
            This method is used for iterator the element s from the given index.

 Object remove(int index) –
            This method is used for remove the particular element at given index and return the deleted object.

 Object set(int index, Object obj) –
            This method is used for add the object at given index, this method override the element if element is already on this position.

List subList(int start, int end) –
            This method is very important. This method gives this list of elements which is found in given range of index.

There are some classes which implements List Interface
  1. AbstractList
  2. AbstractSequentialList
  3. ArrayList
  4. AttributeList
  5. CopyOnWriteArrayList
  6. LinkedList
  7. RoleList
  8. RoleUnresolvedList
  9. Stack
  10. Vector


Popular posts from this blog

What is NBioBSP Java Library?

The NBioBSP Java Library (NBioBSPJNI.jar) is designed to support developers using JAVA
NBioBSP Java Library based Java Native Interface Technology that facilitates easily integration of
NBioBSP by developers using Java development.
The NBioBSP Java Library also uses NBioBSP.dll and provides higher level of interfaces.
NBioBSP Java Library supports almost all NBioBSP functions.

Only valid for NBioBSP.dll version 4.781 or higher.
Only valid for JDK version 1.5.0_20 or higher.

File list :-

■ NBioBSPJNI.jar
This is the java library of the eNBSP SDK.

■ NBioBSPJNI.dll
It implements all java native interfaces. It use with the windows platform.

It implements all java native interfaces. It use with the Linux platform.

Draw arrow line example

Draw arrow line example - 
Its a complete example

import java.awt.*;
import java.awt.geom.*;
import javax.swing.*;

public class Test
public static void main (String args[])
SwingUtilities.invokeLater ( new Runnable () {
Test arrows = new Test();

public void run () {
JFrame frame = new JFrame ( "Arrows" );

frame.add ( new JPanel() {
public void paintComponent ( Graphics g ) {
arrows.draw ( ( Graphics2D ) g, getWidth(), getHeight() );
, BorderLayout.CENTER );

frame.setSize ( 800, 400 );
frame.setDefaultCloseOperation ( JFrame.EXIT_ON_CLOSE );
frame.setVisible ( true );
} );

interface Arrow {
void draw ( Graphics2D g );

Arrow[] arrows = { new LineArrow(), new CurvedArrow() };

void draw ( Graphics2D g, int width, int height )
g.setRenderingHint ( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON );

g.setColor ( Color.WHITE );
g.fillRect ( 0, 0, width, height );

for ( Arrow arrow : arrows ) {
g.setColor ( Color.ORANGE );
g.fillRect ( 350, 20, 20, 2…

Capture image from webcam java code, examples

import java.applet.Applet;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Frame;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.Panel;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.image.BufferedImage;

import javax.swing.JButton;
import javax.swing.JComponent;

import com.sun.image.codec.jpeg.JPEGCodec;
import com.sun.image.codec.jpeg.JPEGEncodeParam;
import com.sun.ima…