Parent-aware unidirectional @OneToMany relationship in Hibernate/JPA

In a classical unidirectional one-to-many relation, the referred entity (Call) is not aware of its parent (Bill). public class Bill { (...) @OneToMany( fetch = FetchType.LAZY, cascade = CascadeType.ALL) <b>@JoinColumn</b>(name = "billId") private Set calls; (...) } Though, there may be some cases, where it is reasonable to make the information of the relation also available in the child entity (again, Call), e.g. if you want to retrieve all Calls of a specific Bill....

April 15, 2013 · 1 min · Markus Ruepp

How to Overwrite Variables in Xsl

XSL is sometimes pretty nasty. Lots of commonly programming stuff isn’t available, p.e. loops. Even the simplest operation - overwriting values of variables - is pretty tricky, and cannot actually been done in the way we would like to. And apparently its not even possible to globally overwrite the value. The only way to set the value of a xsl:variable is to do it at the initialization, in the body of it....

April 29, 2009 · 1 min · Markus Ruepp

Java Charset Encoding Utf 8

One of the most annoying stuff you will definitely come accross is character encoding. When you initialize a String with the default constructor, the JVM uses uses the Charset.defaultCharset() for the encoding. Anothor constructor allows you to specify any Charset, that is available on your box. /* s1 and s2 deliver the same results */ String s1 = new String("hello"); String s2 = new String("hello".getBytes(), Charset.defaultCharset()); // specific encoding, and yes you this ü char there with intent String s3 = new String("grün"....

April 24, 2009 · 2 min · Markus Ruepp