Annotations are a new language feature introduced in Java 5 that allows Java code elements such as classes or methods to be annotated with structured metadata. This metadata can then be used at compile-time or at run-time by other code. Annotations are commonly used to provide configuration information for infrastructure frameworks to provide cross-cutting functionality.
Using […]
Java Server Pages (JSP) is a Java technology for rendering dynamic web pages. Unlike servlets written directly in Java, JSP files contain special markup to identify java or JSP code. The normal (non-markup) text is interpreted as HTML. Early in JSP’s evolution, custom tags were introduced as a way of providing reusable functionality, particularly reusable […]
Audit columns are a common design pattern used to record data creation and modification information for database tables. A typical implementation of this pattern is to add four columns to every non-static database table: CREATE_USER, CREATE_TIMESTAMP, UPDATE_USER, and UPDATE_TIMESTAMP. The create columns are populated only when a record is initially populated, while the update columns […]
My previous article started discussing Hibernate relationships, focusing on lazy versus non-lazy relationships. This article continues the theme by discussing how to improve performance when dealing with relationships in Hibernate through a feature called eager fetching.
Hibernate’s abstraction of database access behind getter and setter methods on domain objects hides potentially inefficient database access. Mindlessly using […]
Support for entity relationships is a great time-saving feature in Hibernate, but it can also be a trap for the unsuspecting developer. Handling relationships between entities can be a complex business, and I for one am glad for all the support that Hibernate provides. Hibernate’s assistance, however, can do more harm than good when it […]
Hibernate tries to hide the details of dealing with relational databases, but it is at best a leaky abstraction. At its most basic level, Hibernate is a framework that issues SQL commands to the database. Sometimes it does not do what you would expect or want (more on that in future articles). Therefore it is […]
Hibernate is a de facto standard for object-relational mapping. One of my recent projects involved the use of the latest version of Hibernate (3.2). Since I had not used Hibernate since its version 2 days, I picked up the authoritative reference Java Persistence with Hibernate which is co-authored by Gavin King, the founder of […]
There is always something more to learn. That was the lesson for me last week when I learned something new about the Java programming language, despite having used professionally it for almost 10 years.
I was upgrading a Java web application to WebSphere server version 6.1 and as the first step I switched the development environment […]
Log4j is a logging framework for Java, part of Apache’s suite of logging frameworks for various languages. While using log4j on various applications, I have had to figure out how to do certain things that were not clearly documented, possibly because the full manual for log4j is only available commercially. Before showing what I have […]
Posted by Basil Vandegriend on August 31st, 2006.
Categories:
Java Tags:
Java
Enumerated types - called enums for short - were introduced to the Java language recently in version 5 (the version after 1.4). The name essentially defines what they are: a type that has a fixed set of constant values.
The Java Sun website has a good tutorial on using enums which covers their basic […]
I’ve worked a lot with XML over the years (i.e. for Ant build files), but I’ve never had to parse or generate XML in Java until recently. There are many options for working with XML in Java, so I thought I’d share the approach I picked. I’ll assume you are already familiar with the basics […]
Posted by Basil Vandegriend on March 23rd, 2006.
Categories:
Java Tags:
Java,
RMI
I recently needed to write a simple java client-server application, and decided to implement the communication mechanism using Java RMI (Remote Method Invocation). I’ve used RMI in the past indirectly (i.e. when coding EJB session beans), but never directly, so I turned to Google to see what RMI tutorials were available. I quickly found several […]
When coding in Java, I prefer to declare local variables at their point of use. On a recent project, I have encountered developers who have been taught in their computing science course(s) to put local variable declarations at the start of the method (when using Java). Back in the days of C this was a […]