Submitted by jjadmin on Sun, 05/01/2016 - 01:31
Write a program that accept two directories (or even two drives or hard disks), efficiently compare them and tell the files/locations which are not same. It should also tell if a file has been changed based on factors such as size, timestamp etc.
Basically it needs to act as a file system backup tool that suggests the files that need to updated to the backup device or vice versa. However, it may not actually copy the files or do the backup.
Submitted by heartin on Sat, 04/30/2016 - 22:32
This is a quick summary of important keywords and reserved words that you should not be using as an identifier. Identifier is a name given to any class, method, interface, enum or variable that we create. There is also added quick notes section with few important keywords that may be useful for exam or interview preparations.
Keywords in Java
class, interface, enum(added in 5.0), package, import, new, this, super, return, void.
Submitted by heartin on Sat, 04/30/2016 - 21:55
Based on the scope in which the variable is declared, we can classify variables as Class variables, Instance Variables and Local variables.
Class variables (or static variables)
Class variables (or static variables) are declared within a class and outside all methods using the static keyword.
Example: Static variable
static int myVar;
Submitted by jjadmin on Fri, 04/22/2016 - 06:45
@Autowired, @Resource, and @Inject are examples for annotations that are used for dependency injection in Spring.
While @Autowired is provided by the Spring framework, @Resource and @Inject are java standard annotations.
When using annotation-based dependency injection, if the dependency is not injected, we would get an exception at the startup of our application itself.
Submitted by jjadmin on Sun, 04/17/2016 - 06:31
Submitted by heartin on Sat, 04/16/2016 - 13:35
A composite key is a primary key composed of multiple columns.
When you are creating a composite key, your persistent class must override the equals() and hashCode() method. This is required for for Hibernate caching to work correctly. It must also implement the Serializable interface.
Best way to do this is to create a class with all your composite key fields, mark it as @Embeddable and then annotate a field of that class type with @Id in your entity class.
Submitted by heartin on Fri, 04/15/2016 - 15:27
An entity is a type on its own and has an existence of its own (e.g. Course, User etc.).
A value type is a type which doesn't have existence of its own, but belongs to an entity (e.g. Address of an User). Value types are always completely owned by their containing entity.
Defining entities and value types in Hibernate
Submitted by heartin on Wed, 04/13/2016 - 21:16
You have different logging options in Hibernate and let us see some of those options quickly. Hibernate supports simple property based log enabling to supporting standard logging frameworks and even programmatically accessing log statistics.
Submitted by heartin on Wed, 04/13/2016 - 20:54
We use various materials like books, internet resources etc. for our learning, for teaching and even for preparing notes. We will list those materials here for your reference. We might include only the very basic information required for our learning and training purposes here. You may refer to these additional materials for further reading and learning.
Submitted by heartin on Wed, 04/13/2016 - 09:00
In JPA, the EntityManager controls the lifecycle of the entities.
Different ORM vendors provide its own entity manager, which is usually a wrapper around the core API and thus supports the JPA programming interfaces, life cycles and query language.
You obtain the EntityManager from an entity manager factory. EntityManagerFactory has the same role as SessionFactory in Hibernate.