[Hibernate-JIRA] Created: (HHH-2617) Warning on tables with inheritance when table defaults are set in entity-mappings
by Stephen Todd (JIRA)
Warning on tables with inheritance when table defaults are set in entity-mappings
---------------------------------------------------------------------------------
Key: HHH-2617
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2617
Project: Hibernate3
Issue Type: Bug
Affects Versions: 3.2.2
Environment: Using Annotations
Reporter: Stephen Todd
Priority: Trivial
Attachments: inheritance-orm.xml, TestSingleTableInheritanceWarnings.java
The following warning message is logged when entity-mapping defaults are set and tables with inheritance are present:
Illegal use of @Table in a subclass of a SINGLE_TABLE hierarchy: class.name.Here
I attached a test case that recreates the problem. Basically, the error occurs when a resource contains persistence-unit-defaults. It appears that hibernate creates an @Table attribute for every registered entity when I think it should only do it for non-single table inheritance entities. Below is an example of the orm.xml
<entity-mappings>
<persistence-unit-metadata>
<persistence-unit-defaults>
<catalog>public</catalog>
</persistence-unit-defaults>
</persistence-unit-metadata>
<entity class="hibernatebugs.TestAnnotationWarnings$ParentEntity">
<inheritance strategy="SINGLE_TABLE"/>
</entity>
</entity-mappings>
Test requires EasyMock and Log4J.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years, 10 months
[Hibernate-JIRA] Created: (HSEARCH-167) Prefix for embedded many-to-one indexing is not applied correctly
by Christian Bauer (JIRA)
Prefix for embedded many-to-one indexing is not applied correctly
-----------------------------------------------------------------
Key: HSEARCH-167
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-167
Project: Hibernate Search
Issue Type: Bug
Components: mapping
Reporter: Christian Bauer
This is with the JAR from trunk I received from Emmanuel a few weeks ago:
@ManyToOne(fetch = FetchType.LAZY)
@org.hibernate.search.annotations.IndexedEmbedded(prefix = "createdBy_")
protected User createdBy;
@ManyToOne(fetch = FetchType.LAZY)
@org.hibernate.search.annotations.IndexedEmbedded(prefix = "lastModifiedBy_")
protected User lastModifiedBy;
And on User class (by the way, it doesn't work with @Indexed on that class, contrary to documentation):
@org.hibernate.search.annotations.Indexed
public class User implements Serializable {
@org.hibernate.search.annotations.DocumentId(name = "userId")
private Long id = null;
@org.hibernate.search.annotations.Field(
index = org.hibernate.search.annotations.Index.UN_TOKENIZED,
store = org.hibernate.search.annotations.Store.YES
)
private String username; // Unique and immutable
}
In the index (checked with Luke) I get:
<createdBy_userId>
<createdBy_username>
<createdBy_usernameusername>
instead of the desired
<createdBy_userId>
<createdBy_username>
<lastModifiedBy_username>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years, 10 months
[Hibernate-JIRA] Created: (EJB-342) event listener (prepersist, preinsert) not firing
by Adam Hardy (JIRA)
event listener (prepersist, preinsert) not firing
--------------------------------------------------
Key: EJB-342
URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-342
Project: Hibernate Entity Manager
Issue Type: Bug
Components: EntityManager
Affects Versions: 3.3.1.GA
Environment: jdk1.5.0_12, linux 2.6
Reporter: Adam Hardy
I have a superclass with several properties, including 'modified', a datetime field which a prepersistlistener should update.
All my entities inherit this superclass.
The superclass is mapped with the appropriate prepersist listener identifying the callback method to call.
<mapped-superclass class="org.permacode.atomic.domain.AtomicEntity"
access="FIELD">
<pre-persist method-name="prePersistCallBack" />
<attributes>
<basic name="ownerId">
<column name="OWNER_ID" />
</basic>
<basic name="created">
<column name="CREATED" />
<temporal>DATE</temporal>
</basic>
<basic name="modified">
<column name="MODIFIED" />
<temporal>DATE</temporal>
</basic>
<version name="version">
<column name="VERSION" />
</version>
</attributes>
</mapped-superclass>
The method prePersistCallBack() is on the superclass:
public void prePersistCallBack()
{
this.modified = new Date();
logger.info("doing prePersistCallBack() - " + this + " - modified="
+ this.modified);
}
I see no logging and I see the SQL statement contains the untouched modified value.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
17 years, 10 months