Possible bug in Hibernate XML based mapping when using properties element

Assume you have a Person with firstName and lastName properties, and a subclass of it called as Vet. You will have hbm.xml mapping files with the following content. Person.hbml.xml <hibernate-mapping> <class name=”com.javaegitimleri.petclinic.model.Person” table=”persons” abstract=”true”> <cache usage=”read-write” /> <id name=”id” column=”ID” access=”field”> <generator /> </id> <version name=”version” column=”VERSION” type=”integer” access=”field” /> <properties name=”firstAndLastName” unique=”true”> <property name=”firstName” […]

Read More →
Error while generating JAXB Classes from XSD File

You may get following error when you try to generate JAXB classes from your XSD files within Eclipse IDE. Error: Could not find or load main class com.sun.tools.internal.xjc.XJCFacade The reason for this error is that you have configured Eclipse to use JRE instead of JDK. If you add a JDK through Window>Preferences>Java>Installed JREs, and select […]

Read More →
Hibernate’de Sınıf İlişkileri 4

Hibernate’deki sınıf ilişkilerini incelediğimiz yazı dizimizin bir önceki bölümünde 1:M ilişkileri incelemeye başlamıştık. Sınıflar arası ilişkilerde en detaylı ilişki türü olan 1:M ilişkileri kaldığımız yerden incelemeye devam edelim. 1:M ilişkilerde kullanılan diğer bir collection tipi ise java.util.List‘dir. List duplikasyona izin verir ve elemanların eklenme sıralarını da korur. Dolayısı ile elemanların liste içerisindeki sırasının veritabanında bir […]

Read More →