Oracle v Google court case started this week: in my own words, here’s a summary of the proceedings so far

If you haven’t been following, Oracle’s lawsuit against Google and their allegations that they ‘stole’ Java to develop Android is in court this week. Groklaw as usual are doing a stellar job to report on the proceedings (Monday, Tuesday, & Wednesday), although nothing earth shattering has happened so far.

Here’s the summary, wording is entirely my own, somewhat loosely based on my understanding of the facts 🙂

Ellison: you stole Java

Page: no we didn't

Ellison: ok, then you didn't license it

Page: we didn't license it because we couldn't come to an
agreement on the terms with Sun, so we developed our own
version based on Apache Harmony

Judge: did Apache Harmony license Java?

Page: no, because they didn't agree to Sun's
licensing terms either, in particular the 'field 
of use' restrictions that limited what types of 
devices a particular version (SE vs ME) of the JVM can run on, that
limits SE for example to only run on desktops and
not on mobile devices

Ellison: but the fact is, to develop your own version
of Java, you should have licensed the TCK to verify
that this was/is a valid version of Java

Page: but it's not Java, its Dalvik. We've
never said it is Java or is called Java

Ellison: ok, then you should have licensed Java to build
a new version of the language using the Java API spec

Page: is there a license for the API spec? The Java
language API is freely available without a license, is it not?

Silence.

Ok. In a nutshell this is my understanding of where the discussions are so far. There seems to be a disagreement whether a license is required or even available to take the API spec for Java and develop your own version of the language. Based on the summaries from the Groklaw site, I get the impression Ellison’s team are accusing Page of things that they’re not sure of themselves – is a license available and/or required to use/read the Java language API spec? I’m not sure, but this is what seems to be the current discussion point.

Also if you build something that is functionally similar to Java, but you don’t call it Java and you don’t pretend to even call it Java, is it Java? If you haven’t blatantly copied copyright code, you rewrote the code again yourself in a cleanroom environment, then have you broken the law? Stay tuned as the court case continues in the coming days (weeks… months….)

Mapping JodaTime properties using JPA and custom UserTypes

JPA does not natively support mapping custom types to table columns. If you’re using Hibernate as your JPA provider then it does support custom UserTypes to provide mappings beyond the normal String to varchar, and other simple types.

For using the JodaTime’s DateTime, there’s a couple of options:

  • Joda Time Hibernate is a Hibernate contributed library (http://joda-time.sourceforge.net/contrib/hibernate/index.html)
  • UserType for Hibernate looks like it is an updated version of Joda Time Hibernate,   adds support for JSR310 (the new JDK Date implementation based on JodaTime), while also keeping backwards compatibility with Joda Time Hibernate

I tried UserType for Hibernate first, but got errors on a Roo generated @RooEntity:

@Type(type="org.joda.time.contrib.hibernate.PersistentDateTime")
private DateTime testDate;

I got this trying to persist:

java.lang.AbstractMethodError: org.jadira.usertype.dateandtime.joda.PersistentDateTime.nullSafeSet(Ljava/sql/PreparedStatement;Ljava/lang/Object;I)V
at org.hibernate.type.CustomType.nullSafeSet(CustomType.java:140)

I’m not sure what this is about so switched the type to the Joda Time Hibernate library, and got it to work as expected straight away:

@Type(type="org.joda.time.contrib.hibernate.PersistentDateTime")
private DateTime testDate;