Monday, 9 May 2011
Sunday, 8 May 2011
Hibernate Tutorial Index
Competitors for Hibernate
Different states of an object in hibernate
Who should use hibernate ?
JDBC vs Hibernate
Entity in ORM
Hibernate Hello World Example using xml configuration
Hibernate Hello World example using annotations
Integrating Hibernate with Spring
Using JPA instead of Hibernate
Benefits of JPA over Hibernate API
JPA support in Application Server
Friday, 22 April 2011
Tuesday, 19 April 2011
Generics : Index or TOC
Motivation behind Generics-Dealing with casting of objects
The Generics Facility
Creating a Generic class
Writing a Generic Method
Naming convention in generics
Generics are syntactic sugar - Type Erasure with Generics
Advantage of Generics
Subtyping a generic type
Wildcards in Generics
Generics classes in java vs templates in c++
Some mistakes to be avoided with generics:
Beginner's mistake of using Object as type parameter to make method generic
Generic methods: How generic are generic method?
Wildcards in Generics
Bounded parametric types
Covariance, contravariance, invariance
Upper bound boundedness in generics
Lower bound boundedness in generics
Multiple bounds in generics
Get and Set principle in generics
Restrictions on wildcards in generics
Expressing dependencies in type parameters : Wildcards vs type parameters
Class objects as type literals
Generic types are not covariant
Type erasure in generics
Making return type of method as generic
Covariant parameter types
Saturday, 26 March 2011
JPA 2.0 with EclipseLink
JPA
Monday, 21 March 2011
Jaxb : TABLE OF CONTENTS
- Jaxb Introduction
- Jaxb Architecture
- Jaxb pre-requisites
- Generating xml from java classes
- Generating java classes from xsd
- Create xsd from java classes
- Generating java classes from xsd using eclipse
- Binding XML Schemas
- Marshalling
- Unmarshalling
- Validation
- More on xml serialization
- Short-comings of jaxb api's
Monday, 14 March 2011
Reflections (toc or index)
Now we can proceed further.
Examining Classes
Following is required to examine a class:First things first. Before you can find out anything about a class, you must first retrieve its corresponding
Class object.It's easy to find out the name of a
Class object. All you have to do is invoke the getName method.This section shows you the methods you need to call to find out what modifiers a particular class has.
In this section you'll learn how to retrieve all of the
Class objects for the ancestors of a given class.If you want to find out what interfaces a class implements, then check out this section.
In this section you'll learn how to tell if a
Class object represents an interface or a class. You'll also get some tips on how to get more information about an interface.This section shows you how to discover what fields belong to a class, and how to find out more about these fields by accessing
Field objects.This section, which introduces the
Constructor class, explains how to get information about a class's contructors.To find out about a class's methods, you need to retrieve the corresponding
Method objects. This section shows you how to do this.Manipulating Objects
Software development tools, such as GUI builders and debuggers, need to manipulate objects at run time. For example, a GUI builder may allow the end-user to select aButton from a menu of components, create the Buttonobject, and then click the Button while running the application within the GUI builder. If you're in the business of creating software development tools, you'll want to take advantage of the reflection API features described in this lesson. - Creating Objects
How can you create an object if you don't know its class name until run time? You'll find the answer in this section. - Getting Field Values
In this section you'll learn how to get the values of an object's fields, even if you don't know the name of the object, or even its class, until run time. - Setting Field Values
Not only can you get field values at run time, you can also set them. This section shows you how. - Invoking Methods
This section shows you how to dynamically invoke methods. Given an object, you can find out what methods its class defines, and then invoke the methods.
Creating Objects
- Using No-Argument Constructors
- Using Constructors that Have Arguments
- Getting Field Values
- Setting Field Values
- Invoking Methods
Working with Arrays
Summary of Classes
Saturday, 25 September 2010
Collection introduction (Index)
2. What are collections?
3. Introduction to collections
In Java 1.2, an entirely new set of interfaces and classes was added to the Java libraries to support more sophisticated collections handling. Earlier there were vectors and hashtable and stack...later came Collections, lists, sets and map. Java 5 introduces queue.
4. Interface in Collections
describes the core collection interfaces, which are the heart and soul of the Java Collections Framework. You'll learn general guidelines for effective use of these interfaces, including when to use which interface. You'll also learn idioms for each interface that will help you get the most out of the interfaces.
Some interfaces in this framework:
- Collection Interface
- Set interface
- The List interface
- Maps in java collections
- SortedSet
- SortedMap
- Iterators
- ListIterator
- Deque
- Comparable
- Comparator
5. Implementations in Collections
describes the JDK's general-purpose collection implementations and tells you when to use which implementation. You'll also learn about the wrapper implementations, which add functionality to general-purpose implementations. Some implementations in java collections:
- Vectors implements RandomAccess //synchronized equivalent of ArrayList
- AbstractCollection implements Collection, Iterable
- AbstractList implements List
- ArrayList implements RandomAccess
- AbstractSequentialList
- LinkedList implements Deque
- Stack //adds peek,push and pop()
- AbstractSet implements Set
- HashSet
- LinkedHashSet
- TreeSet implements SortedSet
- EnumSet // Bitset implementation for Enum class.
- AbstractQueue implements Queue
- PriorityQueue
- ArrayDeque implements Queue Deque
Besides these classes , there is Collections(note plural) or java.util.Collections which has static methods to deal with collections.
6. Algorithms describes the polymorphic algorithms provided by the JDK to operate on collections. With any luck you'll never have to write your own sort routine again!
7. Custom Implementations tells you why you might want to write your own collection implementation (instead of using one of the general-purpose implementations provided by the JDK), and how you'd go about it. It's easy with the JDK's abstract collection.
8. Interoperability tells you how the collections framework interoperates with older APIs that predate the addition of Collections to Java. Also, it tells you how to design new APIs so that they'll interoperate seamlessly with other new APIs.
9. Class or Interface : When using collections?
10. Performance of various collections
- Performance of list implementations
- Performance of set implementations
- Performance of map implementations
Examples