In this post, I will show how can Easy Batch tremendously simplify your batch applications by reducing plumbing code considerably. This will make your applications code more readable, understandable and maintainable!
The use case is a typical production application that loads data from an input CSV flat file to a database. Continue reading
In my previous post I introduced the entity state transitions Object-relational mapping paradigm.
All managed entity state transitions are translated to associated database statements when the current Persistence Context gets flushed. Hibernate’s flush behavior is not always as obvious as one might think. Continue reading
Hibernate shifts the developer mindset from SQL statements to entity state transitions. Once an entity is actively managed by Hibernate, all changes are going to be automatically propagated to the database.
Manipulating domain model entities (along with their associations) is much easier than writing and maintaining SQL statements. Without an ORM tool, adding a new column requires modifying all associated INSERT/UPDATE statements. Continue reading
- Objects Only, No Classes
- Functions are just Values
- The ‘this’ Keyword
- Classic vs Prototypal Inheritance
- Constructors vs Constructor Functions
- Closures vs Lambdas
- Encapsulation and Modules
- Block Scope and Hoisting
I’ve been working on migrating some batch jobs for Podcastpedia.org to Spring Batch. Before, these jobs were developed in my own kind of way, and I thought it was high time to use a more “standardized” approach. Because I had never used Spring with java configuration before, I thought this were a good opportunity to learn about it, by configuring the Spring Batch jobs in java. And since I am all into trying new things with Spring, why not also throw Spring Boot into the boat… Continue reading
If you’ve updated your Apache HTTP Client code to use the newest library (at the time of this writing it is version 4.3.5 for the httpclient and version 4.3.2 for httpcore) from the version 4.2.x you’ll notice that some classes, like
org.apache.http.params.HttpParams have become deprecated. Well, I’ve been there, so in this post I’ll present how to get rid of the warnings by using the new classes. Continue reading
If you find yourself getting the following errror, when trying to send an email in Java:
com.sun.mail.smtp.SMTPSendFailedException: 550 Access denied – Invalid HELO name (See RFC2821 22.214.171.124)
Failed message 1: com.sun.mail.smtp.SMTPSendFailedException: 550 Access denied - Invalid HELO name (See RFC2821 126.96.36.199)
... 43 more
and cannot figure out why does it not work?!, EVEN THOUGH you can send emails via Telnet using the same configuration as the one set up for the Java client or you set the
mail.smtp.localhost property to the fully qualified domain name (FQDN) of the client host – that might be IP address of the client host - as suggested in the JavaMail API FAQ… THEN it might be that you are using an old version of the java mail api. Continue reading
This is a first post in a series of short code snippets that will present the configuration of Spring beans from XML to Java.
<bean id="velocityEngine" class="org.springframework.ui.velocity.VelocityEngineFactoryBean">
Java: Continue reading
In this post I will present how you can format and send automatic emails with Spring and Velocity. Spring offers alone the capability to create simple text emails, which is fine for simple cases, but in typical enterprise application you wouldn’t want to do that for a number of reasons:
- creating HTML-based email content in Java code is tedious and error prone
- there is no clear separation between display logic and business logic
- changing the display structure of the email requires writing Java code, recompiling, redeploying etc
Typically the approach taken to address these issues is to use a template library such as FreeMarker or Velocity to define the display structure of email content. For Podcastpedia I chose Velocity, which is a free open source Java-based templating engine from Apache. In the end my only coding task will be to create the data that is to be rendered in the email template and sending the email.
In this post I will present how to quickly add a “Categories” entry to the menu of a WordPress standard theme. Because I am by no means an expert in WordPress and PHP yet, I wanted to avoid having to customize anything.
So here’s the trick:
In the Dashboard > Appearance > Menus section add a new entry under Links with the URL set to “#” and Link Text set to “Categories”. Once you’ve done click Add to Menu and then from Categeories pull and drop in the Menu Structure the ones you want displayed as sub-items under the newly created entry.