[Hibernate-JIRA] Created: (ANN-826) entity name are useless at least if passed to Session.get(String, ...)
by Paul Pogonyshev (JIRA)
entity name are useless at least if passed to Session.get(String, ...)
----------------------------------------------------------------------
Key: ANN-826
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-826
Project: Hibernate Annotations
Issue Type: Bug
Components: binder
Affects Versions: 3.4.0.GA
Environment: Hibernate 3.3.0.GA, database Oracle 11g (but this is likely irrelevant)
Reporter: Paul Pogonyshev
Attachments: test.diff
Hibernate method Session.get(String, Serializable) has first parameter described as 'the entity name'. However, if in my application I use @Entity(name="foo"), then statement
session.get("foo", ...)
fails with org.hibernate.MappingException: Unknown entity: foo. However, when I specify class name instead it works.
I cannot compile and test hibernate-annotations, but I bet the attached patch should add a relevant test.
--
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
16 years, 5 months
[Hibernate-JIRA] Created: (HHH-3871) unnecessary proxy initialization on audit record save
by Pavla Nováková (JIRA)
unnecessary proxy initialization on audit record save
-----------------------------------------------------
Key: HHH-3871
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3871
Project: Hibernate Core
Issue Type: Bug
Components: envers
Affects Versions: 3.3.1
Environment: Hibernate 3.3.1, Envers 1.2.0, MySQL 5.1
Reporter: Pavla Nováková
Let's have unidirectional mapping @ManyToOne from Item to Category. Consider to set dependency from item instance to category proxy: item.setCategory(categoryProxy) and then call entityManager.merge(item). With enabled auditing this causes unneccessary categoryProxy initialization on persisting item audit record. Please see attachment for Item and Category classes, simple Run class code and final sql output if you want to reproduce the issue. Note that both category and item classes uses business key in their equals and hashCode methods. Calling equals method on uninitialized proxy is probably the reason for its initialization.
--
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
16 years, 5 months
[Hibernate-JIRA] Created: (EJB-381) EntityManager doesn't care about INSERT trigger of Oracle XE
by Juergen Zimmermann (JIRA)
EntityManager doesn't care about INSERT trigger of Oracle XE
------------------------------------------------------------
Key: EJB-381
URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-381
Project: Hibernate Entity Manager
Issue Type: Bug
Affects Versions: 3.4.0.GA
Environment: Hibernate EM 3.4.0, Hibernate Annotations 3.4.0, Hibernate Commons Annotations 3.1.0, Hibernate 3.3.0.SP1, Hibernate Validator 3.1.0.CR2, JDK 1.6.0_07
Reporter: Juergen Zimmermann
I have an abstract entity class with 2 derived concrete classes:
@Entity
@Table(name="kunde")
@Inheritance
@DiscriminatorColumn(name="art", length=1)
@XmlRootElement
@XmlSeeAlso({
Firmenkunde.class,
Privatkunde.class
})
@XmlAccessorType(XmlAccessType.FIELD)
public abstract class Kunde implements java.io.Serializable {
@Id
@GeneratedValue(generator="kunde_sequence_name")
@SequenceGenerator(name="kunde_sequence_name", sequenceName="kunde_k_id_seq", allocationSize=1)
@Column(name="k_id", nullable=false)
@XmlAttribute(name="id", required=true)
protected Long id = KEINE_ID;
@Version
@XmlTransient
protected int version = ERSTE_VERSION;
@Column(length=32, nullable=false)
@XmlElement(required=true)
protected String nachname = "";
...
@Column(length=32, unique=true)
protected String username = "";
...
}
The table is created as follows:
CREATE TABLE kunde(
k_id NUMBER(16) NOT NULL PRIMARY KEY,
version NUMBER(8) DEFAULT 0,
nachname VARCHAR2(32) NOT NULL,
...
art VARCHAR2(2) DEFAULT 'P',
...
username VARCHAR2(32) NOT NULL UNIQUE,
...
);
Additionally there is this sequence and insert trigger for column username.
CREATE SEQUENCE kunde_k_id_seq START WITH 200 NOMAXVALUE
/
CREATE OR REPLACE TRIGGER kunde_trigger_insert
BEFORE INSERT ON kunde
FOR EACH ROW
BEGIN
:NEW.username := TO_CHAR(:NEW.k_id);
END;
/
New objects are inserted into the database using this code which works fine with PostgreSQL. However, using Oracle XE the insert trigger isn't considered:
public List<Kunde> insertKunden(List<Kunde> kunden) {
if (kunden == null || kunden.isEmpty()) {
return new ArrayList<Kunde>(0);
}
for (Kunde k: kunden) {
em.persist(k);
}
return kunden;
}
The attribute "username" is null using Oracle XE, but using PostgreSQL it has the value produced by the INSERT trigger.
--
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
16 years, 5 months
[Hibernate-JIRA] Commented: (HBX-575) Able to add meta information on the reveng.xml file (common configuration for all renerated classes)
by Tonté Pouncil (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HBX-575?page=co... ]
Tonté Pouncil commented on HBX-575:
-----------------------------------
Hi Max,
Is this fix still available in the Hibernate 3.2; because I am trying do what you described as a fix and it does not generate my column an access method of protected? I would have posted this in the hibernate tools forum but right now it is not up because of the JBoss.org link are not linking to it.
I really hope this fix is still availabe as I don't want have to try to muck with the POJO templates. If this feature is no longer availabe, how do I implement this in the source code?
Thanks!
> Able to add meta information on the reveng.xml file (common configuration for all renerated classes)
> ----------------------------------------------------------------------------------------------------
>
> Key: HBX-575
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-575
> Project: Hibernate Tools
> Issue Type: Improvement
> Components: reverse-engineer
> Affects Versions: 3.1beta4
> Reporter: David Leal
> Fix For: 3.2beta9
>
> Attachments: svn-patch2.txt
>
>
> Just to add the posibility to set some meta information common to all possible generated *.hbm files, for example to set that ALL generated file will implement toString method or equal/hash code.
> A good solution whoud be to add some filter options in order to speficy the set of Tables it would apply, using regular expresion, like include nestede target from ant. Something like this:
> <meta attribute name="theAttributeName" value="theValue">
> <include name="theListOfTableToInclude"/>
> <exlude name="theListOfTablesToExclude">
> </meta>
> If it is more complicated just to add the possibility to add meta information for all possible generated files.
--
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
16 years, 5 months
[Hibernate-JIRA] Created: (HHH-3705) NPE encountered on using AnnotationConfiguration
by Kaizer (JIRA)
NPE encountered on using AnnotationConfiguration
------------------------------------------------
Key: HHH-3705
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3705
Project: Hibernate Core
Issue Type: Bug
Components: envers
Affects Versions: 3.3.1
Reporter: Kaizer
Attachments: Hibernate_AnnotationTest.zip
I have a bidirectional association between a Client and a ClientAddress. When I load a Client, the reference of Client set in the ClientAddress is Client_$$_javassist_0 which I think is the proxy. Now when I update or delete the client, I get a NPE -
Exception in thread "main" java.lang.NullPointerException
at org.hibernate.envers.event.AuditEventListener.generateBidirectionalCollectionChangeWorkUnits(AuditEventListener.java:107)
at org.hibernate.envers.event.AuditEventListener.onPostDelete(AuditEventListener.java:153)
at org.hibernate.action.EntityDeleteAction.postDelete(EntityDeleteAction.java:150)
at org.hibernate.action.EntityDeleteAction.execute(EntityDeleteAction.java:117)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:172)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1027)
This is because the entry in the EntitiesConfigurations Map is of Client and not Client_$$_javassist_0.
This works perfectly fine on moving to JPA (EntityManager, etc).
I have attached a test case for the same. The DB settings will need to be changed. The above exception is encountered on running the deleteClient method in HibernateAnnotationTest.java.
--
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
16 years, 5 months
[Hibernate-JIRA] Created: (EJB-418) JBPAPP-1787 - Implement tearDown in EJB3TestCase
by Juraci Paixao Krohling (JIRA)
JBPAPP-1787 - Implement tearDown in EJB3TestCase
------------------------------------------------
Key: EJB-418
URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-418
Project: Hibernate Entity Manager
Issue Type: Bug
Components: EntityManager
Environment: Any database using the tests PersistTest and XmlAttributeOverrideTest.
Reporter: Juraci Paixao Krohling
Attachments: EJB3TestCase.java.diff
https://jira.jboss.org/jira/browse/JBPAPP-1787
There are some tests in EM test suite which subclasses EJB3TestCase (all of them in the package org.hibernate.ejb.test.ops), while most of the other tests subclasses org.hibernate.ejb.test.TestCase.
Tests subclassing EJB3TestCase are not having its tables dropped after the execution, causing failures in other tests which uses the same table names with different table definitions.
How to reproduce:
- Drop all tables from the database to be used in the test
- Run org.hibernate.ejb.test.ops.PersistTest#testBasic
- There should be, among others, three tables: employer_employee,employer,employee
- Run org.hibernate.ejb.test.xml.XmlAttributeOverrideTest#testAttributeOverriding
- It should fail to drop the table "employee" (check the logs), failing with "java.sql.BatchUpdateException: Unknown column 'home_city' in 'field list'"
- Drop all tables from the database
- Run org.hibernate.ejb.test.xml.XmlAttributeOverrideTest#testAttributeOverriding again
- There should be no failures.
--
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
16 years, 5 months