embed « Component « JPA Q&A





1. Hibernate not creating entity tables if embedding components    stackoverflow.com

I have made an application using Java/Hibernate/MySQL, but whenever I try running it, it complains that the table for one of my entity classes has not been created. After some trial and ...

2. Entity contained in embedded component doesn't persist    forum.hibernate.org

@Entity @Table(name="aml_comment") public class Comment { @Id @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="commentSequence") @SequenceGenerator(name="commentSequence", sequenceName="seq_comment", allocationSize=1) private int id; @Column(length=1000) private String text; /** time the comment was entered */ @Column(name="time_of", nullable=false) ...

3. Object with two embedded components of the same class    forum.hibernate.org

Hello, I'd like to store objects that can have i18n data string properties. Eg, their properties can be stored in different locales. I have created the following class (it's actually Groovy code and annotations, it does not make much difference though) import javax.persistence.* import org.hibernate.annotations.* @Embeddable class LocalizedString { @CollectionOfElements(targetElement = String.class) @JoinTable(name = "language_string", joinColumns = [@JoinColumn(name = "localized_string_id")]) @org.hibernate.annotations.MapKey(targetElement ...

4. Embedded Components - not working    forum.hibernate.org

Hello, I have had some problems embedding components for my project, using Java Persistence Annotations and MySQL. More specifically, Hibernate does not throw any exception while building the tables, however, Hibernate does not create the corresponding table, thus eventually throwing "table does not exist" exceptions. This behaviour happens with the following code: Code: @Entity public class TestEmb { private ...