[Hibernate-JIRA] Created: (WEBSITE-4) Getting Started Tutorial not working
by Bernard (JIRA)
Getting Started Tutorial not working
------------------------------------
Key: WEBSITE-4
URL: http://opensource.atlassian.com/projects/hibernate/browse/WEBSITE-4
Project: Hibernate Website
Issue Type: Bug
Environment: n.a
Reporter: Bernard
Priority: Blocker
The first tutorial at
http://docs.jboss.org/hibernate/core/3.6/quickstart/en-US/html/hibernate-...
with the code downloaded from a link
http://docs.jboss.org/hibernate/core/3.6/quickstart/en-US/html/files/hibe...
on that page is not working.
How to reproduce:
- Unzip the file
- open the root directory containing the parent POM with the latest version of NetBEans.
The project shows errors as follows (right click on project node)
Your project has dependencies that are not resolved locally. Code completion in the IDE will not include classes from these dependencies or their transitive dependencies (unless they are among the open projects).
Please download the dependencies, or install them manually, if not available remotely.
The artifacts are:
org.hibernate:hibernate-core:jar:3.6.0.CR2
javassist:javassist:jar:3.12.0.GA
When attempting to resolve the issues by downloading the libraries, this does not work.
The above is the core of the issue, and we don't actually need to say more about it. With Maven as the build environment, everything should just work for a beginner!
...
However, I figured out that the latest versions of Hibernate are not in the central repository, so I added the JBoss repository to NetBeans at the cost of downloading another 70MBytes index. Then I added to the POM:
<repositories>
<repository>
<id>repository.jboss.org</id>
<url>https://repository.jboss.org/nexus/</url>
</repository>
</repositories>
And it still does not work because:
[ERROR]Failed to execute goal on project hibernate-tutorial-hbm: Could not resolve dependencies for project org.hibernate.tutorials:hibernate-tutorial-hbm:jar:3.6.0.CR2: The following artifacts could not be resolved: org.hibernate:hibernate-core:jar:3.6.0.CR2, javassist:javassist:jar:3.12.0.GA: Could not find artifact org.hibernate:hibernate-core:jar:3.6.0.CR2 in repository.jboss.org (https://repository.jboss.org/nexus/) -> [Help 1]
In addition it appears that I cannot view the details of org.hibernate:hibernate-core:jar:3.6.0.CR2 in the repository browser because of a similar error.
But that are all details that I shouldn't have to get involved in, as I said, it should just work.
--
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
14 years, 10 months
[Hibernate-JIRA] Created: (HHH-5748) java.util.Map.get(string) returns null value if there is no value for the key searched.
by Suresh Thummalapenta (JIRA)
java.util.Map.get(string) returns null value if there is no value for the key searched.
---------------------------------------------------------------------------------------
Key: HHH-5748
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5748
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.6.0
Reporter: Suresh Thummalapenta
Priority: Minor
We developed a mining-based approach that recovers specifications for APIs of JavaSDK and uses those specifications to detect defects statically. In our study, we found that at various places, return checks are missing in the core component of Hibernate. It would be great if you could analyze and fix those issues.
class: ManagedSessionContext.java
Method: existingSession, Line 124
Missing null check for "sessionMap.get( factory )", since java.util.Map.get(string) returns null value if there is no value for the key searched in the Map
Class: NamedParameterSpecification.java
Method: bind, Line 66
Missing null check for qp.getNamedParameters().get( name ), since get() method returns null value if there is no value for the key searched in the map.
class: PersistentIdentifierBag.java
Method: equalsSnapshot, Line 231
Missing null check on "old" in the statement "Object old = snap.get(id);", since get() method returns null value if there is no value for the key searched in the map.
Class: StructuredCacheEntry.java
Method: destructure, Line: 54
Missing null check on the return of map.get( names[i] ), since get() method returns null value if there is no value for the key searched in the map.
--
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
14 years, 10 months
[Hibernate-JIRA] Created: (HHH-5746) Return value check missing for List.get(int)
by Suresh Thummalapenta (JIRA)
Return value check missing for List.get(int)
--------------------------------------------
Key: HHH-5746
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5746
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.6.0
Reporter: Suresh Thummalapenta
Priority: Minor
We developed a mining-based approach that recovers specifications for APIs of JavaSDK and uses those specifications to detect defects statically. In our study, we found that at various places, return checks are missing in the core component of Hibernate. It would be great if you could analyze and fix those issues.
List.get(int) can result in IndexOutOfBoundsException when the index value is outside the range. To avoid this exception, it is better to have a condition check on the size of the list before invoking the get method.
Class: HqlSqlWalker.java
Method: lookupNonQualifiedProperty, Line 598
Method: postProcessDML, Line 679
Class: PersistentBag.java
Method: getSnapshotElement, Line 405
public Object getSnapshotElement(Object entry, int i) {
List sn = (List) getSnapshot();
return sn.get(i);
}
Class: StandardQueryCache.java
Method: get, line 128
--
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
14 years, 10 months
[Hibernate-JIRA] Created: (HHH-5745) Incorrect usage of Iterator.next method
by Suresh Thummalapenta (JIRA)
Incorrect usage of Iterator.next method
---------------------------------------
Key: HHH-5745
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5745
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.6.0
Reporter: Suresh Thummalapenta
Priority: Minor
We developed a mining-based approach that recovers specifications for APIs of JavaSDK and uses those specifications to detect defects statically. In our study, we found that at various places, return checks are missing in the core component of Hibernate. It would be great if you could analyze and fix those issues.
It would be good to have a condition check on hasNext() before invoking getColumnIterator().next(), since the next() method can throw NoSuchElementExcetion if there are no elements. currently, it is missing in the following places:
Class: AbstractEntityPersister.java
method: AbstractEntityPersister, Line: 511
Class: SimpleValue.java
Method: createIdentifierGenerator, Line: 165
Class: SingleTableEntityPersister.java
Method: SingleTableEntityPersister, Line: 294
Class: Table.java
Method: sqlCreateString, Line: 398
--
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
14 years, 10 months
[Hibernate-JIRA] Created: (HHH-4453) Reserved keywords not quoted in table/column names
by Philipp Reichart (JIRA)
Reserved keywords not quoted in table/column names
--------------------------------------------------
Key: HHH-4453
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4453
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.3.1
Environment: Hibernate 3.3.1 GA, Windows XP, Sun JDK 1.6.0_06, Derby 10.5
Reporter: Philipp Reichart
I'm currently migrating our test suite form HSQLDB to Derby (we need transaction isolation and the HSLDB 1.9 RCs are no good), and found out that we have a lot of table or colum names that happen to be reserved keywords in Derby, like "transaction", "key", "value", "year", etc..
The usual workaround seems to be adding backticks to any offending table/column name in our hbm.xml files, but that's really an ugly workaround and doesn't prevent later incidents of this kind when new keywords show up in either our mappings or database. As this is about a production database schema, reanming the table/column names isn't an option either.
I already tried implementing a custom Derby dialect and registering all the keywords from the Derby doc at http://db.apache.org/derby/docs/10.5/ref/rrefkeywords29722.html and even defined a "quote everything" NamingStrategy using the dialect to get the correct native quotes for the database.
Unfortunately, neither the Hibernate DDL generator nor HQL queries seem to consider the naming strategy or dialect when handling table or column names.
Is there any way to have Hibernate quote database-specific keywords every they're used?
Or just have Hibernate quote everything that comes from a mapping file?
--
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
14 years, 10 months
[Hibernate-JIRA] Updated: (HHH-1904) Identifier too long (reborn)
by Santiago Ennis (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1904?page=c... ]
Santiago Ennis updated HHH-1904:
--------------------------------
Attachment: schema-export-long-fk-name.zip
TestCase too generate "identifier too long" error.
> Identifier too long (reborn)
> ----------------------------
>
> Key: HHH-1904
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1904
> Project: Hibernate Core
> Issue Type: Bug
> Affects Versions: 3.2.0.cr2
> Reporter: Andrea Aime
> Attachments: schema-export-long-fk-name.zip
>
>
> I'm following up form HHH-355, basically, foreign keys with names that go well beying 30 chars of lenght.
> I know how to reproduce the problem, and if required I can provide a test case, but let me point you to
> the code path that generates the problem first (and see if that's enough).
> I do have a hierarchy mapped with the table per class approach, with intermediate abstract classes.
> Leaf classes of this hierarchy are apparently managed in hibernate usign the DenormalizedTable class. The code that generates the foreign keys for this class is:
> public void createForeignKeys() {
> includedTable.createForeignKeys();
> Iterator iter = includedTable.getForeignKeyIterator();
> while ( iter.hasNext() ) {
> ForeignKey fk = (ForeignKey) iter.next();
> createForeignKey(
> fk.getName() + Integer.toHexString( getName().hashCode() ),
> fk.getColumns(),
> fk.getReferencedEntityName()
> );
> }
> }
> As you can see, it gets the foreign key name of the contained class, and appends another hexstring. This name can become really long if the
> hierarchy has many levels. In my case I get names as long as: FK14F780C41886F83e63ff56e238e868d73630607.
> Let me know if this is enough or if you need more information.
> Ah, another problem is that the appended foreign parts do not pass thru the naming strategy, and as you can see they're not
> uppercase in my sample (my naming strategy does uppercase everything)
--
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
14 years, 10 months
[Hibernate-JIRA] Commented: (HHH-1904) Identifier too long (reborn)
by Santiago Ennis (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1904?page=c... ]
Santiago Ennis commented on HHH-1904:
-------------------------------------
Faced the same problem last night...
DenormalizedTable#createForeignKeys() generates longer and longer ForeignKey names; which results in "identifier is too long" ERROR while schema export. I think the method generated longer names when there are three or more entities in the inheritance hierarchy and the InheritanceType is TABLE_PER_CLASS. If there are three or more entities in the inheritance hierarchy but the InheritanceType is NOT TABLE_PER_CLASS, SchemaExport does not show any errors.
See the output of SchemaExportTest.java (test-case attached) :-
===============================================================
SchemaExport:262 - exporting generated schema to database
SchemaExport:415 - drop table employee cascade constraints
SchemaExport:415 - drop table organization cascade constraints
SchemaExport:415 - drop table software_developer cascade constraints
SchemaExport:415 - drop table users cascade constraints
SchemaExport:415 - create table employee (id varchar2(255 char) not null, organization_entity_id varchar2(255 char) not null, user_name varchar2(255 char) not null, first_name varchar2(255 char), last_name varchar2(255 char), primary key (id))
SchemaExport:415 - create table organization (entity_id varchar2(255 char) not null, name varchar2(255 char) not null unique, primary key (entity_id))
SchemaExport:415 - create table software_developer (id varchar2(255 char) not null, organization_entity_id varchar2(255 char) not null, user_name varchar2(255 char) not null, first_name varchar2(255 char), last_name varchar2(255 char), core_skill varchar2(255 char), primary key (id))
SchemaExport:415 - create table users (id varchar2(255 char) not null, organization_entity_id varchar2(255 char) not null, user_name varchar2(255 char) not null, primary key (id))
SchemaExport:415 - alter table employee add constraint FK4692D487849C3FF6a68e084722e6ae foreign key (organization_entity_id) references organization
SchemaExport:386 - Unsuccessful: alter table employee add constraint FK4692D487849C3FF6a68e084722e6ae foreign key (organization_entity_id) references organization
SchemaExport:387 - ORA-00972: identifier is too long
SchemaExport:415 - alter table software_developer add constraint FK4692D487849C3FF6a68e084722e6aea409f32 foreign key (organization_entity_id) references organization
SchemaExport:386 - Unsuccessful: alter table software_developer add constraint FK4692D487849C3FF6a68e084722e6aea409f32 foreign key (organization_entity_id) references organization
SchemaExport:387 - ORA-00972: identifier is too long
SchemaExport:415 - alter table users add constraint FK4692D487849C3FF6a68e08 foreign key (organization_entity_id) references organization
SchemaExport:281 - schema export complete
==========================================================
One more thing...
Though the SchemaExport completed with errors, the log says, "schema export complete" and the level of log is INFO.
IMHO, the message should be "schema export complete WITH ERRORS" and the log level should be ERROR(or WARN).
> Identifier too long (reborn)
> ----------------------------
>
> Key: HHH-1904
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1904
> Project: Hibernate Core
> Issue Type: Bug
> Affects Versions: 3.2.0.cr2
> Reporter: Andrea Aime
>
> I'm following up form HHH-355, basically, foreign keys with names that go well beying 30 chars of lenght.
> I know how to reproduce the problem, and if required I can provide a test case, but let me point you to
> the code path that generates the problem first (and see if that's enough).
> I do have a hierarchy mapped with the table per class approach, with intermediate abstract classes.
> Leaf classes of this hierarchy are apparently managed in hibernate usign the DenormalizedTable class. The code that generates the foreign keys for this class is:
> public void createForeignKeys() {
> includedTable.createForeignKeys();
> Iterator iter = includedTable.getForeignKeyIterator();
> while ( iter.hasNext() ) {
> ForeignKey fk = (ForeignKey) iter.next();
> createForeignKey(
> fk.getName() + Integer.toHexString( getName().hashCode() ),
> fk.getColumns(),
> fk.getReferencedEntityName()
> );
> }
> }
> As you can see, it gets the foreign key name of the contained class, and appends another hexstring. This name can become really long if the
> hierarchy has many levels. In my case I get names as long as: FK14F780C41886F83e63ff56e238e868d73630607.
> Let me know if this is enough or if you need more information.
> Ah, another problem is that the appended foreign parts do not pass thru the naming strategy, and as you can see they're not
> uppercase in my sample (my naming strategy does uppercase everything)
--
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
14 years, 10 months