<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Java Persistence on Laliluna.de - Sebastian Hennebrüder</title><link>https://www.laliluna.de/tags/java-persistence/</link><description>Recent content in Java Persistence on Laliluna.de - Sebastian Hennebrüder</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Tue, 27 Jan 2009 00:00:00 +0000</lastBuildDate><atom:link href="https://www.laliluna.de/tags/java-persistence/index.xml" rel="self" type="application/rss+xml"/><item><title>Performance Tuning Tips for Hibernate and Java Persistence</title><link>https://www.laliluna.de/articles/java-persistence-hibernate/performance-tips-hibernate-java-persistence.html</link><pubDate>Tue, 27 Jan 2009 00:00:00 +0000</pubDate><guid>https://www.laliluna.de/articles/java-persistence-hibernate/performance-tips-hibernate-java-persistence.html</guid><description>&lt;p&gt;This article is an extract of the&#10;chapter Performance of my book &lt;b&gt;Hibernate and Java Persistence by&#10;Example&lt;/b&gt;. &#10;&lt;/p&gt;&#10;&lt;p&gt;The book is available in English as&#10;eBook (PDF document) and in German as paper book. The eBook is&#10;continuously updated and covers the newest features of Hibernate. You&#10;will find a complete table of content on my website&#10;http://www.laliluna.de&lt;/p&gt;&#10;&lt;h2&gt;Introduction&lt;/h2&gt;&#10;&lt;p&gt;There is a incredible choice of options&#10;to improve the performance of Hibernate based application. This&#10;chapter describes quite a number of them. Each part starts with a&#10;small use case describing the problem or requirement. After this you&#10;will find a detailed solution how to solve the problem.&lt;/p&gt;</description></item><item><title>Hibernate annotation reference (German)</title><link>https://www.laliluna.de/articles/java-persistence-hibernate/annotation-reference.html</link><pubDate>Thu, 01 Jan 2009 00:00:00 +0000</pubDate><guid>https://www.laliluna.de/articles/java-persistence-hibernate/annotation-reference.html</guid><description>&lt;p&gt;This are includes a reference of all Hibernate, JPA and EJB annotations. It is provided in German&#10; only.&lt;/p&gt;&#10;&#10;&lt;fieldset&gt;&#10; &lt;legend&gt;@javax.persistence.AttributeOverride&lt;/legend&gt;&#10; &lt;a href="https://www.laliluna.de/articles/java-persistence-hibernate/javax.persistence.attributeoverride.html"&gt;Description of&#10; @javax.persistence.AttributeOverride&lt;/a&gt;&#10;&lt;/fieldset&gt;&#10;&lt;fieldset&gt;&#10; &lt;legend&gt;@javax.persistence.AttributeOverrides&lt;/legend&gt;&#10; &lt;a href="https://www.laliluna.de/articles/java-persistence-hibernate/javax.persistence.attributeoverrides.html"&gt;Description of&#10; @javax.persistence.AttributeOverrides&lt;/a&gt;&#10;&lt;/fieldset&gt;&#10;&lt;fieldset&gt;&#10; &lt;legend&gt;@javax.persistence.Basic&lt;/legend&gt;&#10; &lt;a href="https://www.laliluna.de/articles/java-persistence-hibernate/javax.persistence.basic.html"&gt;Description of @javax.persistence.Basic&lt;/a&gt;&#10;&lt;/fieldset&gt;&#10;&lt;fieldset&gt;&#10; &lt;legend&gt;@javax.persistence.Column&lt;/legend&gt;&#10; &lt;a href="https://www.laliluna.de/articles/java-persistence-hibernate/javax.persistence.column.html"&gt;Description of @javax.persistence.Column&lt;/a&gt;&#10;&lt;/fieldset&gt;&#10;&lt;fieldset&gt;&#10; &lt;legend&gt;@javax.persistence.DiscriminatorColumn&lt;/legend&gt;&#10; &lt;a href="https://www.laliluna.de/articles/java-persistence-hibernate/javax.persistence.discriminatorcolumn.html"&gt;Description of&#10; @javax.persistence.DiscriminatorColumn&lt;/a&gt;&#10;&lt;/fieldset&gt;&#10;&lt;fieldset&gt;&#10; &lt;legend&gt;@javax.persistence.DiscriminatorValue&lt;/legend&gt;&#10; &lt;a href="https://www.laliluna.de/articles/java-persistence-hibernate/javax.persistence.discriminatorvalue.html"&gt;Description of&#10; @javax.persistence.DiscriminatorValue&lt;/a&gt;&#10;&lt;/fieldset&gt;&#10;&lt;fieldset&gt;&#10; &lt;legend&gt;@javax.persistence.Embeddable&lt;/legend&gt;&#10; &lt;a href="https://www.laliluna.de/articles/java-persistence-hibernate/javax.persistence.embeddable.html"&gt;Description of @javax.persistence.Embeddable&lt;/a&gt;&#10;&lt;/fieldset&gt;&#10;&lt;fieldset&gt;&#10; &lt;legend&gt;@javax.persistence.Embedded&lt;/legend&gt;&#10; &lt;a href="https://www.laliluna.de/articles/java-persistence-hibernate/javax.persistence.embedded.html"&gt;Description of @javax.persistence.Embedded&lt;/a&gt;&#10;&lt;/fieldset&gt;&#10;&lt;fieldset&gt;&#10; &lt;legend&gt;@javax.persistence.EmbeddedId&lt;/legend&gt;&#10; &lt;a href="https://www.laliluna.de/articles/java-persistence-hibernate/javax.persistence.embeddedid.html"&gt;Description of @javax.persistence.EmbeddedId&lt;/a&gt;&#10;&lt;/fieldset&gt;&#10;&lt;fieldset&gt;&#10; &lt;legend&gt;@javax.persistence.Entity&lt;/legend&gt;&#10; &lt;a href="https://www.laliluna.de/articles/java-persistence-hibernate/javax.persistence.entity.html"&gt;Description of @javax.persistence.Entity&lt;/a&gt;&#10;&lt;/fieldset&gt;&#10;&lt;fieldset&gt;&#10; &lt;legend&gt;@javax.persistence.Enumerated&lt;/legend&gt;&#10; &lt;a href="https://www.laliluna.de/articles/java-persistence-hibernate/javax.persistence.enumerated.html"&gt;Description of @javax.persistence.Enumerated&lt;/a&gt;&#10;&lt;/fieldset&gt;&#10;&lt;fieldset&gt;&#10; &lt;legend&gt;@javax.persistence.GeneratedValue&lt;/legend&gt;&#10; &lt;a href="https://www.laliluna.de/articles/java-persistence-hibernate/javax.persistence.generatedvalue.html"&gt;Description of @javax.persistence.GeneratedValue&lt;/a&gt;&#10;&lt;/fieldset&gt;&#10;&lt;fieldset&gt;&#10; &lt;legend&gt;@javax.persistence.Id&lt;/legend&gt;&#10; &lt;a href="https://www.laliluna.de/articles/java-persistence-hibernate/javax.persistence.id.html"&gt;Description of @javax.persistence.Id&lt;/a&gt;&#10;&lt;/fieldset&gt;&#10;&lt;fieldset&gt;&#10; &lt;legend&gt;@javax.persistence.IdClass&lt;/legend&gt;&#10; &lt;a href="https://www.laliluna.de/articles/java-persistence-hibernate/javax.persistence.idclass.html"&gt;Description of @javax.persistence.IdClass&lt;/a&gt;&#10;&lt;/fieldset&gt;&#10;&lt;fieldset&gt;&#10; &lt;legend&gt;@javax.persistence.Inheritance&lt;/legend&gt;&#10; &lt;a href="https://www.laliluna.de/articles/java-persistence-hibernate/javax.persistence.inheritance.html"&gt;Description of @javax.persistence.Inheritance&lt;/a&gt;&#10;&lt;/fieldset&gt;&#10;&lt;fieldset&gt;&#10; &lt;legend&gt;@javax.persistence.Lob&lt;/legend&gt;&#10; &lt;a href="https://www.laliluna.de/articles/java-persistence-hibernate/javax.persistence.lob.html"&gt;Description of @javax.persistence.Lob&lt;/a&gt;&#10;&lt;/fieldset&gt;&#10;&lt;fieldset&gt;&#10; &lt;legend&gt;@javax.persistence.ManyToMany&lt;/legend&gt;&#10; &lt;a href="https://www.laliluna.de/articles/java-persistence-hibernate/javax.persistence.manytomany.html"&gt;Description of @javax.persistence.ManyToMany&lt;/a&gt;&#10;&lt;/fieldset&gt;&#10;&lt;fieldset&gt;&#10; &lt;legend&gt;@javax.persistence.ManyToOne&lt;/legend&gt;&#10; &lt;a href="https://www.laliluna.de/articles/java-persistence-hibernate/javax.persistence.manytoone.html"&gt;Description of @javax.persistence.ManyToOne&lt;/a&gt;&#10;&lt;/fieldset&gt;&#10;&lt;fieldset&gt;&#10; &lt;legend&gt;@javax.persistence.MappedSuperclass&lt;/legend&gt;&#10; &lt;a href="https://www.laliluna.de/articles/java-persistence-hibernate/javax.persistence.mappedsuperclass.html"&gt;Description of&#10; @javax.persistence.MappedSuperclass&lt;/a&gt;&#10;&lt;/fieldset&gt;&#10;&lt;fieldset&gt;&#10; &lt;legend&gt;@javax.persistence.OneToMany&lt;/legend&gt;&#10; &lt;a href="https://www.laliluna.de/articles/java-persistence-hibernate/javax.persistence.onetomany.html"&gt;Description of @javax.persistence.OneToMany&lt;/a&gt;&#10;&lt;/fieldset&gt;&#10;&lt;fieldset&gt;&#10; &lt;legend&gt;@javax.persistence.OneToOne&lt;/legend&gt;&#10; &lt;a href="https://www.laliluna.de/articles/java-persistence-hibernate/javax.persistence.onetoone.html"&gt;Description of @javax.persistence.OneToOne&lt;/a&gt;&#10;&lt;/fieldset&gt;&#10;&lt;fieldset&gt;&#10; &lt;legend&gt;@javax.persistence.SecondaryTable&lt;/legend&gt;&#10; &lt;a href="https://www.laliluna.de/articles/java-persistence-hibernate/javax.persistence.secondarytable.html"&gt;Description of @javax.persistence.SecondaryTable&lt;/a&gt;&#10;&lt;/fieldset&gt;&#10;&lt;fieldset&gt;&#10; &lt;legend&gt;@javax.persistence.SequenceGenerator&lt;/legend&gt;&#10; &lt;a href="https://www.laliluna.de/articles/java-persistence-hibernate/javax.persistence.sequencegenerator.html"&gt;Description of&#10; @javax.persistence.SequenceGenerator&lt;/a&gt;&#10;&lt;/fieldset&gt;&#10;&lt;fieldset&gt;&#10; &lt;legend&gt;@javax.persistence.Table&lt;/legend&gt;&#10; &lt;a href="https://www.laliluna.de/articles/java-persistence-hibernate/javax.persistence.table.html"&gt;Description of @javax.persistence.Table&lt;/a&gt;&#10;&lt;/fieldset&gt;&#10;&lt;fieldset&gt;&#10; &lt;legend&gt;@javax.persistence.TableGenerator&lt;/legend&gt;&#10; &lt;a href="https://www.laliluna.de/articles/java-persistence-hibernate/javax.persistence.tablegenerator.html"&gt;Description of @javax.persistence.TableGenerator&lt;/a&gt;&#10;&lt;/fieldset&gt;&#10;&lt;fieldset&gt;&#10; &lt;legend&gt;@javax.persistence.Temporal&lt;/legend&gt;&#10; &lt;a href="https://www.laliluna.de/articles/java-persistence-hibernate/javax.persistence.temporal.html"&gt;Description of @javax.persistence.Temporal&lt;/a&gt;&#10;&lt;/fieldset&gt;&#10;&lt;fieldset&gt;&#10; &lt;legend&gt;@javax.persistence.Transient&lt;/legend&gt;&#10; &lt;a href="https://www.laliluna.de/articles/java-persistence-hibernate/javax.persistence.transient.html"&gt;Description of @javax.persistence.Transient&lt;/a&gt;&#10;&lt;/fieldset&gt;&#10;&lt;fieldset&gt;&#10; &lt;legend&gt;@javax.persistence.UniqueConstraint&lt;/legend&gt;&#10; &lt;a href="https://www.laliluna.de/articles/java-persistence-hibernate/javax.persistence.uniqueconstraint.html"&gt;Description of&#10; @javax.persistence.UniqueConstraint&lt;/a&gt;&#10;&lt;/fieldset&gt;&#10;&lt;fieldset&gt;&#10; &lt;legend&gt;@javax.persistence.Version&lt;/legend&gt;&#10; &lt;a href="https://www.laliluna.de/articles/java-persistence-hibernate/javax.persistence.version.html"&gt;Description of @javax.persistence.Version&lt;/a&gt;&#10;&lt;/fieldset&gt;&#10;&lt;fieldset&gt;&#10; &lt;legend&gt;@org.hibernate.annotations.CollectionOfElement&lt;/legend&gt;&#10; &lt;a href="https://www.laliluna.de/articles/java-persistence-hibernate/org.hibernate.annotations.collectionofelement.html"&gt;Description of&#10; @org.hibernate.annotations.CollectionOfElement&lt;/a&gt;&#10;&lt;/fieldset&gt;&#10;&lt;fieldset&gt;&#10; &lt;legend&gt;@org.hibernate.annotations.DiscriminatorFormula&lt;/legend&gt;&#10; &lt;a href="https://www.laliluna.de/articles/java-persistence-hibernate/org.hibernate.annotations.discriminatorformula.html"&gt;Description of&#10; @org.hibernate.annotations.DiscriminatorFormula&lt;/a&gt;&#10;&lt;/fieldset&gt;&#10;&lt;fieldset&gt;&#10; &lt;legend&gt;@org.hibernate.annotations.Entity&lt;/legend&gt;&#10; &lt;a href="https://www.laliluna.de/articles/java-persistence-hibernate/org.hibernate.annotations.entity.html"&gt;Description of @org.hibernate.annotations.Entity&lt;/a&gt;&#10;&lt;/fieldset&gt;&#10;&lt;fieldset&gt;&#10; &lt;legend&gt;@org.hibernate.annotations.Formula&lt;/legend&gt;&#10; &lt;a href="https://www.laliluna.de/articles/java-persistence-hibernate/org.hibernate.annotations.formula.html"&gt;Description of&#10; @org.hibernate.annotations.Formula&lt;/a&gt;&#10;&lt;/fieldset&gt;&#10;&lt;fieldset&gt;&#10; &lt;legend&gt;@org.hibernate.annotations.GenericGenerator&lt;/legend&gt;&#10; &lt;a href="https://www.laliluna.de/articles/java-persistence-hibernate/org.hibernate.annotations.genericgenerator.html"&gt;Description of&#10; @org.hibernate.annotations.GenericGenerator&lt;/a&gt;&#10;&lt;/fieldset&gt;&#10;&lt;fieldset&gt;&#10; &lt;legend&gt;@org.hibernate.annotations.Index&lt;/legend&gt;&#10; &lt;a href="https://www.laliluna.de/articles/java-persistence-hibernate/org.hibernate.annotations.index.html"&gt;Description of @org.hibernate.annotations.Index&lt;/a&gt;&#10;&lt;/fieldset&gt;&#10;&lt;fieldset&gt;&#10; &lt;legend&gt;@org.hibernate.annotations.Parent&lt;/legend&gt;&#10; &lt;a href="https://www.laliluna.de/articles/java-persistence-hibernate/org.hibernate.annotations.parent.html"&gt;Description of @org.hibernate.annotations.Parent&lt;/a&gt;&#10;&lt;/fieldset&gt;&#10;&lt;fieldset&gt;&#10; &lt;legend&gt;@org.hibernate.annotations.Table&lt;/legend&gt;&#10; &lt;a href="https://www.laliluna.de/articles/java-persistence-hibernate/org.hibernate.annotations.table.html"&gt;Description of @org.hibernate.annotations.Table&lt;/a&gt;&#10;&lt;/fieldset&gt;</description></item><item><title>Problem using Hibernate Annotations</title><link>https://www.laliluna.de/articles/2007/03/06/hibernate-annotation-problem.html</link><pubDate>Tue, 06 Mar 2007 00:00:00 +0000</pubDate><guid>https://www.laliluna.de/articles/2007/03/06/hibernate-annotation-problem.html</guid><description>&lt;p&gt;Column annotation are ignored, if you mix the targets where you place them.&lt;/p&gt;&#10;&lt;p&gt;I assigned the @Id annotation to the field and the other annotations to a method. If the @Id annotation is assigned to a field, further method annotations are ignored and vice versa.&lt;/p&gt;&#10;&lt;p&gt;Below you can see an example class explaining the problem. The @Column annotation of getNameMethod is ignored.&lt;/p&gt;&#10;&lt;pre class="language-java"&gt;&#10;package de.laliluna.annotation;&#10;&#10;import java.io.Serializable;&#10;@Entity&#10;public class SimpleBean implements Serializable {&#10;&#10; public static void main(String[] args) {&#10; new SchemaExport(new AnnotationConfiguration().configure()).create(true, false);&#10;&#10; }&#10;&#10; @Id&#10; private Integer id;&#10;&#10; private String nameMethod;&#10;&#10; @Column(name = "name_field")&#10; private String nameField;&#10;&#10; public Integer getId() {&#10; return id;&#10; }&#10;&#10; public void setId(Integer id) {&#10; this.id = id;&#10; }&#10;&#10; public String getNameField() {&#10; return nameField;&#10; }&#10;&#10; public void setNameField(String nameField) {&#10; this.nameField = nameField;&#10; }&#10;&#10; @Column(name = "name_method")&#10; public String getNameMethod() {&#10; return nameMethod;&#10; }&#10;&#10; public void setNameMethod(String nameMethod) {&#10; this.nameMethod = nameMethod;&#10; }&#10;&#10;}&#10;&lt;/pre&gt;</description></item></channel></rss>