Getting a list of all Licenses in a Project

In a regular project you are using a handfull Software Libraries. Every Library in your project can use a different license. To get a list of all licenses which are used in your project can be difficult. You can double check the license for every single library in your project manually. But that is time intensive and a pain in the ass!

VersionEye is offering a quick solution for that. You can get the license list in less than 1 minute. After your login you are in “My Projects”. Click the link “Add New Project” in the left nav bar, to create a new project.

Screen Shot 2013-02-04 at 5.40.07 PM

Simply upload a project file. A pom.xml, Gemfile, composer.json, package.json, dependency.gradle or another supported file with your dependencies. After the upload you will see a tab with all the dependencies.

Screen Shot 2013-02-04 at 5.40.53 PM

Simply click on the “License” tab to see all licenses in this project. And here it is.

Screen Shot 2013-02-04 at 5.41.17 PM

In this example most Libraries are using the MIT License. Some of them are under “Ruby” license and for 1 Library VersionEye was not able to detect a license.

It’s that simple. Let me know if you have questions to this.

JsonIgnoreProperties

If you are using the Jackson project to parse JSON files than I recommend to use the “@JsonIgnoreProperties” Annotation. Assume that you have a JSON String like this, with 2 properties:

{
  "name" : "mike", 
  "sex" : "male"
}

If you want to parse that with Jackson, you have to create a class like this.


public class User {

private String name;
private String sex;

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public String getSex() {
    return sex;
  }

  public void setSex(String sex) {
    this.sex = sex;
  }
}

And with Jackson you can map it like this:


ObjectMapper mapper = new ObjectMapper();
 User user = mapper.readValue(reader, User.class);

So far so good. As soon somebody adds a another Property to the JSON stream, your code breaks. Yes! :-)
Because Jackson tries to map every Property from the JSON to your class. Assume somebody ads the Property “age” and the JSON looks now like this:

{
  "name" : "mike", 
  "sex" : "male",
  "age" : "19"
}

Now Jackson tries to map “age” to the User class. And because their is no getter and setter your code will break with a nice Exception. Happy Exception Handling :-)
If you want to avoid this strange behavior, than put this Annotation on top of your User class: “@JsonIgnoreProperties(ignoreUnknown = true)”. With that Jackson will ignore unknown Properties.

I don’t know why I have to use this Annotation. For me it is pretty clear that an Exception occurs if I call an non existing setter. I mean ignoring unknown properties should be the default behavior. Everything else just doesn’t make any sense for me.

JsonAnySetter

I am using the Jackson JSON Lib in Java to process JSON. If you don’t know how JSON works in Ruby, you will like this project. Anyway. If you have dynamic JSON stream where the property names are not always the same, than you need the “@JsonAnySetter” Annotation. With that you can map dynamic Properties to a map.


private Map<String, Object> all = new HashMap<String, Object>();

@JsonAnySetter
public void set(String name, Object value) {
   all.put(name, value);
}

public Map<String, Object> getAll() {
   return all;
}

public void setAll(Map<String, Object> all) {
   this.all = all;
}

That worked out for me, for a String – String pair.

Automated Business Logic

If you are working with Hibernate this might be interesting for your. Automated Business Logic (ABL) is a Library which helps you to manage your Business Logic. It handles Cross Cutting Concerns and Multi Table Views. You just need to add a couple Annotations to your code. Take a look tot this demo here:

http://www.automatedbusinesslogic.com/live-demo

It just takes a couple minutes.

And here is ready to go Maven2 Archetype for ABL + Hibernate.

http://www.automatedbusinesslogic.com/maven-demo

You can follow ABL @VersionEye to get notifed about new releases.

http://versioneye.com/package/com~autobizlogic~abl–autobizlogic

Java Driver for Firebase

I just started a new Project @ GitHub, called jfirebase. That is basically a Java Wrapper for the REST API of Firebase. Clone the git repo and build the package with Maven2 / Maven3 like this:

mvn -Dmaven.test.skip=true package

There are Unit Tests for the project but If you want to run the test cases you have to add your firebase channel to the test classes.

You can install the JAR file with this command into your local Maven Repository:

mvn -Dmaven.test.skip=true install

The Driver contains basically 5 methods to interact with Firebase.

  • boolean write(Map<String, String> map)
  • Reader read(String uri)
  • boolean delete(String uri)
  • void setChannel(String channel)
  • String setKey(String key)

Here is an example for writing data to Firebase.

Map data = new HashMap();
data.put("firstname", "Robert");
data.put("lastname", "Reiz");
IDriver driver = new Driver();
driver.setChannel("http://YOUR_CHANNEL_AT_FIREBASE");
driver.write(data);

Your channel would be something like: “http://demo.firebase.com/myprojectname&#8221;.

OK. Here is an example for reading data.

IDriver driver = new Driver();
driver.setChannel("http://demo.firebase.com/SampleChat/");
Reader reader = driver.read("users/jack");
try{
   ObjectMapper mapper = new ObjectMapper();
   User user = mapper.readValue(reader, User.class);
   System.out.println(user.getName());
} catch (Exception ex){
   ex.printStackTrace();
}

The “read” method returns a “java.io.Reader”. With that you can do what you want. I am using here the jackson-core-lgpl JSON Mapper to map the JSON String from Firebase to my Java class User.

The delete method is pretty straight forward:

IDriver driver = new Driver();
driver.setChannel("http://demo.firebase.com/SampleChat/");
boolean deleted = driver.delete("user/jack");

Let me know if you have questions.

Maven2 Archetypes – Yes or No ?

A good friend of my is working on a cool project. A plugin for the Hibernate Persistence Framework. I am helping out with testing. And a couple days ago we had this discussion about how to get started with a project. I recommended to offer a Maven2 Archetype.

I asked Max if I can publish his E-Mail on my blog and take the conversation public. And here is his E-Mail:

———–

Hi Robert,
further thoughts on the Maven archetype idea. Having played with it, it doesn’t really seem practical because we don’t know what framework our users will be using. We could conceivably come up with an archetype for Grails, one for Spring, one for ZK, etc…
What we have done is Mavenize the basic demo so you can just download it and run it with mvn tomcat:run. That makes the zip file just 97k, which is nice. This is also true for the Grails demo.
I think it makes sense to make the tutorial a Maven project, but I don’t really see the value of making it an archetype. People will not want to create new projects based on this particular project — which uses plain old JSP. They’ll just get the basic project and fiddle with it while following the tutorial.
Your thoughts would be appreciated.
Thanks,
– Max

Uploading Artifacts to the central maven repository

Do you ever tried to upload an artifact to the central maven repository server? No? Well, that is not fun! The maven guys are pretty serious!

OK. If you want to upload something you “just” have to read this tutorial here:

http://maven.apache.org/guides/mini/guide-central-repository-upload.html

AND this super long tutorial here:

https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide

On maven.apache.org they tell you that the most easiest way to upload something is over sonatype. You just have to create a user in their JIRA bug tracking tool and open a ticket! *LOL* Are you serious? Publishing software by opening a ticket in a bug tracking tool? Really? Reaaaaalllllyyyyyyyy?

Are you fu**ing kidding me?

And the best part is, that your ticket will be handled in just 2 business days. Wow.

No wonder that every company and even small open source teams are setting up their own Maven2 Repository.

To publish a open source project in RubyGems.org took me less than 5 min and it was published immediately. And I don’t know one single Ruby coder which is managing his own RubyGems Server.

Absent Code attribute

By executing the Unit Tests with TestNG for this Maven2 Archetype here:

http://robert-reiz.com/2012/02/18/archetype-richfaces-4-1-0-final-spring-3-1-0-release-hibernate-3-3-0/

I got this Exception:

Absent Code attribute in method that is not native or abstract in class file javax/faces/lifecycle/Lifecycle

This project is annotation driven. The JSF Managed Beans are annotated with Spring Annotations:

@Component
@Scope("request")

in the applicationContext.xml I have this lines here to read the annotations:

<context:annotation-config/>
<context:component-scan base-package="com.versioneye" />

I created a second applicationContext.xml for the test environment and modified the annotation-config. In the test environment I am scanning now just the peristence package. Because there are anyway no Unit Tests for the JSF Managed Beans.

<context:annotation-config/>
<context:component-scan base-package="com.versioneye.persistence"/>

Since I am not scanning the Managed Beans in the test environment I didn’t get the Exception above.

Archetype: RichFaces 4.1.0.Final + Spring 3.1.0.RELEASE + Hibernate 3.3.0

This maven2 archetype contains a little sample web application with this Frameworks:

  • Spring 3.1.0.RELEASE Framework
  • Servlet-API 2.5
  • JSF 2.0 (mojarra 2.1.2)
  • RichFaces 4.1.0.Final
  • ploinFaces 1.6
  • ploinMailFactory 1.3.1
  • Hibernate 3.3.0
  • TestNG 5.8
  • Log4J 1.2.15
  • HSQLDB 1.8.0.7

The configuration is annotation-driven. It is deployed on the PLOIN Repository-Server

http://www.ploin-m2.de/nexus/content/groups/public/

you can create a project from the archetype with the following command:

mvn archetype:generate -DarchetypeGroupId=org.ploin.archetype -DarchetypeArtifactId=demoSpringRichHibernate-archetype -DarchetypeVersion=1.2 -DarchetypeRepository=http://www.ploin-m2.de/nexus/content/groups/public/ -DgroupId=com.versioneye -DartifactId=myNewWebApp

The created project is a very simple web-application with a login mask and 2 xhtml-sites. I have tested the app on a tomcat 6.0.35 and Java 1.6 on Mac OS X Lion.

On the second page there is a small demonstration of the JSF 2.0 AJAX feature. Every time you type something in into the first input field, there is a whole server roundtrip. The ManagedBean gets updated immediately.

On the same page there is a small demo for the RichFaces calendar.

After the creation the app is running with the HypersoniceSQL DBMS. But it is very easy to switch to MySQL or Oracle. I put the drivers for MySQL and Oracle as a comment in the pom.xml. So you just need to comment in the right lines in the pom.xml.

EL Problems on Tomcat 6.0.35

Yesterday I wanted to start a new JSF archetype and I got this exception:

java.lang.LinkageError: loader constraint violation: when resolving interface method "javax.servlet.jsp.JspApplicationContext.getExpressionFactory()Ljavax/el/ExpressionFactory;" the class loader (instance of org/apache/catalina/loader/WebappClassLoader) of the current class, com/sun/faces/config/ConfigureListener, and the class loader (instance of org/apache/catalina/loader/StandardClassLoader) for resolved class, javax/servlet/jsp/JspApplicationContext, have different Class objects for the type javax/el/ExpressionFactory used in the signature

This happens if you have an “el-api.jar” in your project. The same jar file is already in the tomcat “lib” directory. I just removed the “el-api.jar” from my libs and than it worked out for me.

Unable to locate Spring NamespaceHandler for XML schema namespace

I am working on a backend Maven3 project. I am building an uber JAR which contains several other JAR files and resources. That worked pretty good. But than I tried to run the JAR file with

java -jar <uber-super-duper-jar-file>

I got this Exception:

INFO  org.springframework.beans.factory.xml.XmlBeanDefinitionReader  - Loading XML bean definitions from class path resource [applicationContext.xml]
Exception in thread "main" org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/context]

This is because I have several Spring Jar in my dependencies. Some of the spring jars contain meta info files with the same name. To avoid that some meta files are overridden you have to merge it. If you are using the maven shade plugin to build your JAR file you can do the merge with this xml snippet:

<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
  <resource>META-INF/spring.handlers</resource>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
  <resource>META-INF/spring.schemas</resource>
</transformer>

Here is a more detailed description:

http://maven.apache.org/plugins/maven-shade-plugin/examples/resource-transformers.html

Using Java in Rails with JRuby

JRuby is a pretty good Java implementation of Ruby. One of the biggest advantages of JRuby is that you can use Java Classes in your Ruby on Rails App. You can import JARs and take advantages of all the Java Libraries and Frameworks. In that way you don’t have to throw away your old Java Code. You can build a JAR and use it inside your new fancy Ruby App.

I recommend to build a Uber JAR, which contains all dependencies of your Java App. That is more easy to handle. You have to put your Uber JAR into the “lib” directory of your rails app. Than you have to import the JAR in the “application.rb”.

require "lib/your-java-all.jar"

That’s it! Know you can access the Classes inside the JAR. If you want to use a Java Class in a Controller you have to include the class:

include_class Java::org.trophic.graph.service.LocationServiceImpl
include_class Java::org.trophic.graph.factory.LocationFactory

And here is how you can use the Java Classes:

locationService = LocationFactory.locationService
locations = locationService.locations

And here is the full example of the controller:

class PageController < ApplicationController

  include_class Java::org.trophic.graph.service.LocationServiceImpl
  include_class Java::org.trophic.graph.factory.LocationFactory

  def home
      locationService = LocationFactory.locationService
      @locations = locationService.locations
  end

end

It is super easy! Isn’t it?

JRuby + Spring + AspectJ + Neo4J

I am playing around with JRuby and Neo4j as Graph Engine. My set up on the backend side contains a Java Application with Spring Annotations, AspectJ and Neo4J. In the frontend I have a Rails App with JRuby.

Any time I try to access a class that have an annotation like “@NodeEntity”, I get an Exception. It seems that Spring and AspectJ is to much in this chain. I should get rid of Spring and AspectJ.

Uber JAR with Maven

By default maven is generating a small JAR file, which just contains your compiled classes and other project files. If you want to have a single JAR file which also includes all dependent JAR files, you have to create a uber JAR. You can do that with the maven shade plugin. Just put this lines of xml into your pom.xml.

</pre>
<build>
<plugins>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
	<version>1.4</version>
	<executions>
		<execution>
			<phase>package</phase>
			<goals>
				<goal>shade</goal>
			</goals>
			<configuration>
				<shadedArtifactAttached>true</shadedArtifactAttached>
				<shadedClassifierName>all</shadedClassifierName>
			</configuration>
		</execution>
	</executions>
      </plugin>
   </plugins>
 </build>
<pre>

In Maven you can solve every problem. You just need enough XML code for that. If you still have problems, than probably your pom.xml is to short. :-)

 

PSQLException: The column index is out of range: 1, number of columns: 0

I tried to write a insert statement with Spring JDB Template for an PostgreSQL Database. My insert string looked like this:

final String sql = "INSERT INTO products (prod_name, prod_key, artifact_id, group_id, link, src, prod_type) VALUES ('?','?','?','?','?','?','?')";

And I got this Exception:

PreparedStatementCallback; SQL []; The column index is out of range: 1, number of columns: 0.; nested exception is org.postgresql.util.PSQLException: The column index is out of range: 1, number of columns: 0.

The Problem was that I used ” ‘ ” inside of the sql string close to the “?”. After I removed the ” ‘ ” strings it worked perfectly.

Archetype: RichFaces 4.0.0.M1 + Spring 3.0.5.RELEASE + Hibernate 3.3.0

This maven2 archetype contains a little sample web application with this Frameworks:

  • Spring 3.0.5.RELEASE Framework
  • Servlet-API 2.5
  • JSF 2.0 (mojarra 2.1.2)
  • RichFaces 4.0.0.M1
  • ploinFaces 1.6
  • ploinMailFactory 1.3.1
  • Hibernate 3.3.0
  • TestNG 5.8
  • Log4J 1.2.15
  • HSQLDB 1.8.0.7

The configuration is annotation-driven. It is deployed on the PLOIN Repository-Serve

http://www.ploin-m2.de/nexus/content/groups/public/

you can create a project from the archetype with the following command:

mvn archetype:generate -DarchetypeGroupId=org.ploin.archetype -DarchetypeArtifactId=tempSpringRichHibernate -DarchetypeVersion=1.7.2 -DarchetypeRepository=http://www.ploin-m2.de/nexus/content/groups/public/ -DgroupId=org.ploin -DartifactId=demoSpringRichHibernate

The created project is a very simple web-application with a login mask and 2 xhtml-sites. I have tested the app on a tomcat 6.0.20 and Java 1.6 on Mac OS X Snow Leopard.

rich-faces-login
rich-faces-login

You can login with the username “admin” and the password “admin”.

After the creation the app is running with the HypersoniceSQL DBMS. But it is very easy to switch to MySQL or Oracle. I put the drivers for MySQL and Oracle as a comment in the pom.xml. So you just need to comment in the right lines in the pom.xml.

.gitignore

If you want that git is ignoring some files for you you just have to create the “.gitignore” file in your project root. Here you can add all the files you don’t want have in your git repository. For example some meta files from IntelliJ IDEA.

*.iml
*.ipr
*.iws
.idea/

SqlServer 2008 with Hibernate 3.6.4

The current stable version if Hibernate is 3.6.4.FINAL. In this version the Dialect for the SqlServer 2008 from Microsoft looks like this:

public class SQLServer2008Dialect extends SQLServerDialect {
  public SQLServer2008Dialect(){
    registerColumnType( Types.DATE, "date" );
    registerColumnType( Types.TIME, "time" );
    registerColumnType( Types.TIMESTAMP, "datetime2" );

    registerFunction( "current_timestamp", new NoArgSQLFunction("current_timestamp", Hibernate.TIMESTAMP,false) );
  }
}

A litle bit short. If you have some problems with this Dialect you should write your own Dialect. This class here is a customized SqlServerDialect from the Hibernate 4 Project. For me it works fine together with SqlServer 2008 R2.

import org.hibernate.Hibernate;
import org.hibernate.cfg.Environment;
import org.hibernate.dialect.SQLServer2005Dialect;
import org.hibernate.dialect.function.*;
import org.hibernate.type.StandardBasicTypes;

import java.sql.Types;

public class SqlServer2008Dialect extends SQLServer2005Dialect {

 public SqlServer2008Dialect(){
 super();

 registerColumnType( Types.DATE, "date" );
 registerColumnType( Types.TIME, "time" );
 registerColumnType( Types.TIMESTAMP, "datetime2" );

 registerFunction( "current_timestamp", new NoArgSQLFunction("current_timestamp", Hibernate.TIMESTAMP,false) );

 registerColumnType( Types.BIT, "tinyint" ); //Sybase BIT type does not support null values
 registerColumnType( Types.BIGINT, "bigint" );     //changed
 registerColumnType( Types.SMALLINT, "smallint" );
 registerColumnType( Types.TINYINT, "tinyint" );
 registerColumnType( Types.INTEGER, "int" );
 registerColumnType( Types.CHAR, "char(1)" );
 registerColumnType( Types.VARCHAR, "varchar($l)" );
 registerColumnType( Types.FLOAT, "float" );
 registerColumnType( Types.DOUBLE, "double precision" );

 registerColumnType( Types.VARBINARY, "varbinary($l)" );
 registerColumnType( Types.NUMERIC, "numeric($p,$s)" );
 registerColumnType( Types.BLOB, "image" );
 registerColumnType( Types.CLOB, "text" );
 registerColumnType( Types.ROWID, "bigint");

 registerFunction( "ascii", new StandardSQLFunction("ascii", StandardBasicTypes.INTEGER) );
 registerFunction( "char", new StandardSQLFunction("char", StandardBasicTypes.CHARACTER) );
 registerFunction( "len", new StandardSQLFunction("len", StandardBasicTypes.LONG) );
 registerFunction( "lower", new StandardSQLFunction("lower") );
 registerFunction( "upper", new StandardSQLFunction("upper") );
 registerFunction( "str", new StandardSQLFunction("str", StandardBasicTypes.STRING) );
 registerFunction( "ltrim", new StandardSQLFunction("ltrim") );
 registerFunction( "rtrim", new StandardSQLFunction("rtrim") );
 registerFunction( "reverse", new StandardSQLFunction("reverse") );
 registerFunction( "space", new StandardSQLFunction("space", StandardBasicTypes.STRING) );

 registerFunction( "user", new NoArgSQLFunction("user", StandardBasicTypes.STRING) );

 registerFunction( "current_timestamp", new NoArgSQLFunction("getdate", StandardBasicTypes.TIMESTAMP) );
 registerFunction( "current_time", new NoArgSQLFunction("getdate", StandardBasicTypes.TIME) );
 registerFunction( "current_date", new NoArgSQLFunction("getdate", StandardBasicTypes.DATE) );

 registerFunction( "getdate", new NoArgSQLFunction("getdate", StandardBasicTypes.TIMESTAMP) );
 registerFunction( "getutcdate", new NoArgSQLFunction("getutcdate", StandardBasicTypes.TIMESTAMP) );
 registerFunction( "day", new StandardSQLFunction("day", StandardBasicTypes.INTEGER) );
 registerFunction( "month", new StandardSQLFunction("month", StandardBasicTypes.INTEGER) );
 registerFunction( "year", new StandardSQLFunction("year", StandardBasicTypes.INTEGER) );
 registerFunction( "datename", new StandardSQLFunction("datename", StandardBasicTypes.STRING) );

 registerFunction( "abs", new StandardSQLFunction("abs") );
 registerFunction( "sign", new StandardSQLFunction("sign", StandardBasicTypes.INTEGER) );

 registerFunction( "acos", new StandardSQLFunction("acos", StandardBasicTypes.DOUBLE) );
 registerFunction( "asin", new StandardSQLFunction("asin", StandardBasicTypes.DOUBLE) );
 registerFunction( "atan", new StandardSQLFunction("atan", StandardBasicTypes.DOUBLE) );
 registerFunction( "cos", new StandardSQLFunction("cos", StandardBasicTypes.DOUBLE) );
 registerFunction( "cot", new StandardSQLFunction("cot", StandardBasicTypes.DOUBLE) );
 registerFunction( "exp", new StandardSQLFunction("exp", StandardBasicTypes.DOUBLE) );
 registerFunction( "log", new StandardSQLFunction( "log", StandardBasicTypes.DOUBLE) );
 registerFunction( "log10", new StandardSQLFunction("log10", StandardBasicTypes.DOUBLE) );
 registerFunction( "sin", new StandardSQLFunction("sin", StandardBasicTypes.DOUBLE) );
 registerFunction( "sqrt", new StandardSQLFunction("sqrt", StandardBasicTypes.DOUBLE) );
 registerFunction( "tan", new StandardSQLFunction("tan", StandardBasicTypes.DOUBLE) );
 registerFunction( "pi", new NoArgSQLFunction("pi", StandardBasicTypes.DOUBLE) );
 registerFunction( "square", new StandardSQLFunction("square") );
 registerFunction( "rand", new StandardSQLFunction("rand", StandardBasicTypes.FLOAT) );

 registerFunction("radians", new StandardSQLFunction("radians", StandardBasicTypes.DOUBLE) );
 registerFunction("degrees", new StandardSQLFunction("degrees", StandardBasicTypes.DOUBLE) );

 registerFunction( "round", new StandardSQLFunction("round") );
 registerFunction( "ceiling", new StandardSQLFunction("ceiling") );
 registerFunction( "floor", new StandardSQLFunction("floor") );

 registerFunction( "isnull", new StandardSQLFunction("isnull") );

 registerFunction( "concat", new VarArgsSQLFunction( StandardBasicTypes.STRING, "(","+",")" ) );

 registerFunction( "length", new StandardSQLFunction( "len", StandardBasicTypes.INTEGER ) );
 registerFunction( "trim", new SQLFunctionTemplate( StandardBasicTypes.STRING, "ltrim(rtrim(?1))") );
 registerFunction( "locate", new CharIndexFunction() );

 getDefaultProperties().setProperty(Environment.STATEMENT_BATCH_SIZE, NO_BATCH);
 }

}
 

You can just copy & pate it to your own project. If you want to use it, just add the dialect to your hibernate.properties.

hibernate.dialect=org.<your_package_name>.SqlServer2008Dialect

Customized MySql5Dialect for Hibernate

By default the MySqlDialect who is coming with Hibernate does MySQL not force to UTF. And by default all binary columns are mapped to “tinyblob”. That’s why I wrote my own Dialect. It is very easy to do. Just a fiew lines of code. Here is my own MySql5Dialect.

import org.hibernate.dialect.MySQL5InnoDBDialect;

import java.sql.Types;

public class MySql5Dialect extends MySQL5InnoDBDialect {

  public String getTableTypeString() {
    return " ENGINE=InnoDB DEFAULT CHARSET=utf8";
  }

  public MySql5Dialect() {
    super();
    registerColumnType( Types.BINARY, "MEDIUMBLOB" );
  }

}

You can use by adding this to your hibernate.properties files:

hibernate.dialect=org.<your_package_name>.MySql5Dialect