[Hibernate-JIRA] Created: (EJB-257) EJB3Configuration still needing hibernate.cfg.xml for programatic EntityManagerConfiguration construction
by Khalil Bouhamza (JIRA)
EJB3Configuration still needing hibernate.cfg.xml for programatic EntityManagerConfiguration construction
---------------------------------------------------------------------------------------------------------
Key: EJB-257
URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-257
Project: Hibernate Entity Manager
Type: Bug
Components: EntityManager
Versions: 3.2.0.ga
Environment: Hibernate 3.2.0 GA
Hibernate Annotations 3.2.0 GA
Hibernate Entity Manager 3.2.0 GA
Reporter: Khalil Bouhamza
Priority: Minor
Attachments: EJB3ConfigurationHibernateCfgXmlInitTest.java
I am opening this issue following Emmanuel's request on http://forum.hibernate.org/viewtopic.php?p=2332948#2332948
The tescase attached is a junit Test that shows that an empty hibernate.cfg.xml and the call cfg.configure("/mypath/hibernate.cfg.xml") as shown in the reference documentation http://www.hibernate.org/hib_docs/entitymanager/reference/en/html/configu... is needed for EntityManagerFactory programatic construction.
The TestCase shows two scnerios with and without hibernate.cfg.xml. The scenarios are building a EntityManagerFactory and either try to persist or retrive an entity of type org.hibernate.ejb.test.Distributor included in HEM's test suite. The hibernate.cfg.xml file is genrated at Runtime and deleted upon VM exit, the varaiable HIBERNATE_CFG_XML_DIR should point to a folder on the classpath. It is created within the initWithHibernateCfgXML method and it is really a file with the bear minimum of empty tags. There are four tests, two failing and the other two passing, the passing tests create the temp XML config file if not already created, and then make the cfg.configure(resource) call, then simply invoke the corresponding failing test.
I hope the TestCase and the above explanation are describing the issue properly.
--
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] Commented: (HHH-1488) ArrayIndexOOB exception: org.hibernate.event.def.DefaultFlushEntityEventListener:checkNaturalId(), line 79
by Øyvind Roth (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1488?page=c... ]
Øyvind Roth commented on HHH-1488:
----------------------------------
This bug also applies to 3.2.2. Please fix this old (soon one year) blocking bug. I can't understand why it has got such a low priority as to the time it takes to fix it. Even when the priority has been increased to Major... The reference reads: " ...you should still try to identify natural keys for all entities. ...". Which is of no use in Hibernate as it crashes. And it's blocking me.
> ArrayIndexOOB exception: org.hibernate.event.def.DefaultFlushEntityEventListener:checkNaturalId(), line 79
> ----------------------------------------------------------------------------------------------------------
>
> Key: HHH-1488
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1488
> Project: Hibernate3
> Type: Bug
> Components: core
> Versions: 3.1.2
> Environment: Windows, Sun 1.5 JDK, Hibernate 3.1.2, Oracle 9i
> Reporter: Dave Nebinger
>
>
> The checkNaturalId() method has a bug. Basically it's using "loaded[prop]" in the isEqual() method call but it should be using "loaded[i]".
> The value for prop is the index into the array of properties for the entity where the natural key is. The value for i is the index in the loaded[] array that is being checked. In my case I've got a single natural key so loaded[0] equals the natural key value, but it is located at position 1 in the properties[15] array.
> The full line, "if ( !types[prop].isEqual( current[prop], loaded[prop], entityMode ) ) {" throws ArrayIndexOOB exception since prop is 1 but only loaded[0] (i) is valid.
> The fix is quite simple, just change the line to read: "if ( !types[prop].isEqual( current[prop], loaded[i], entityMode ) ) {"
--
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: (HBX-881) Enable first-class support of Enum types in the Query Parameters view
by Joseph Marques (JIRA)
Enable first-class support of Enum types in the Query Parameters view
---------------------------------------------------------------------
Key: HBX-881
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-881
Project: Hibernate Tools
Type: New Feature
Versions: 3.2beta8
Reporter: Joseph Marques
Granted, Enums are persisted as either ints or strings, but that doesn't mean that the Query Parameters view can't support Enums as a first-class construct in the Type column. I suppose there are a few different ways to support this, but let me explain the semantics that I think would make the most sense for supreme usability:
Select "enum" for the "Type" column
Then you specify the class in the "Value" column (identical to how it works when "class" is selected for the "Type" column)
Then, the tools should be able to be clever enough to read the mapping strategy for this enum based on the context of where it is being used in the corresponding hql/jpql statement. The tools would then map the Enum class to it's appropriate int or string representation during query translation / execution. This allows the query writer to be more effective because he/she wouldn't have to know the actual enum mapping strategy to be able to mock up and test the query.
--
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: (HBX-878) Support comment-naming of tabs in the Hibernate Query Result view
by Joseph Marques (JIRA)
Support comment-naming of tabs in the Hibernate Query Result view
-----------------------------------------------------------------
Key: HBX-878
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-878
Project: Hibernate Tools
Type: New Feature
Versions: 3.2beta8
Reporter: Joseph Marques
Let's pretend some long query looks like this:
"select a from A a inner join a.bs b inner join b.cs c where b.nested.prop = :bval and c.nested.prop = :cval"
When I execute this query a tab is created in the Hibernate Query Result view with the title equal to the entire query itself. I propose that the HQL editor allow some simple form of comments above the query, which will then act as logic name for the tab. In other words:
// A.getAsByComplexBCSubselect
"select a from A a inner join a.bs b inner join b.cs c where b.nested.prop = :bval and c.nested.prop = :cval"
Then, if the user highlights both of these lines, he is intentioning that he wants the tab to be named by using the contents in the first line comment. And if the first line isn't a comment, well then you could always default back to the classic functionality of putting the entire query into the tab title.
Optionally, if the user doesn't have a specific name for it, but still doesn't want a tab that spans the entire length of the IDE, he could use something like:
//
"select a from A a inner join a.bs b inner join b.cs c where b.nested.prop = :bval and c.nested.prop = :cval"
to intimate that he wants the tab to show up as something short. It could be as simple as "unnamed1", "unnamed2", "unnamed3", etc, just as long as it's short and sweet and allows for more than one tab title to be seen simultaneously for long queries.
--
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