| The @Transient annotation seems to be ignored in an @Embeddable object within another @Embeddable object. Following is the szenario: I have translatable fields for an entity (Book) which are mapped by a language key and stored in a separate table like this:
@ElementCollection(targetClass = BookTranslation.class, fetch = FetchType.LAZY)
@CollectionTable(name = "BOOK_TRANSLATION", joinColumns = @JoinColumn(name = "BOOK_ID"))
@MapKeyClass(String.class)
@MapKeyColumn(name = "LANGUAGE_KEY")
private Map<String, BookTranslation> translations = new HashMap<>();
The BookTranslation itself contains another @Embedded object (ImageObject) which has a field annotated with @Transient. In this case, the annotation seems to be ignored and the following exception is thrown, when trying to start the application:
org.hibernate.PropertyNotFoundException: Could not locate setter method for property [com.synconia.bookstore.entity.ImageObject#referenceType]
If a setter method is present, the application starts but a DDL-generation would generate also a column for the field annotated with _ hibernate-embedded-transient.zip @Transient_. See the example attached. |