[Hibernate-JIRA] Created: (HBX-929) Enable base class generation
by Norman Franke (JIRA)
Enable base class generation
----------------------------
Key: HBX-929
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-929
Project: Hibernate Tools
Issue Type: New Feature
Components: datagen, hbm2java
Affects Versions: 3.2beta9
Environment: Hibernate 3.2.3
Reporter: Norman Franke
Using the reverse engineering features, I'd like to be able to have it generate base classes (e.g. TableNameBase) and yet tell Hibernate to use the parent class, e.g. TableName. I read that one can add a meta attribute "generated-class" to do this but (a) there is no way to make this happen via the Eclipse Plugin and (b) even if one modifies the template to add it, it doesn't seem to pick it up (it does end up in the resulting hbm.xml files.) The Run... GUI can't seem to generate Java files from the hbm.xml files either, so one must reverse engineer anyway, which is another annoyance.
--
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, 8 months
[Hibernate-JIRA] Created: (HHH-2547) Incorrect update strings when using rowid
by Gail Badner (JIRA)
Incorrect update strings when using rowid
-----------------------------------------
Key: HHH-2547
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2547
Project: Hibernate3
Issue Type: Bug
Components: core
Affects Versions: 3.2.3
Environment: Oracle 10.2.0.1.0; Oracle JDBC 10.2.0.3
Reporter: Gail Badner
Priority: Minor
The fix for HHH-2469 introduced a new bug when an update spans more than one table.
I've added a joined subclass, NamedPoint, to org.hibernate.test.rowid.RowIdTest and added a new test that reproduces the problem. Using this test case, the fix for HHH-2469 results in the following update strings:
update Point set description=? where rowid=?
update Point set description=? where \"x\"=? and \"y\"=?
update NamedPoint set name=? where \"x\"=? and \"y\"=?
The first statement is the intended optimization for the second statement. This optimization is supposed to replace the second (default) update statement.
Because the update spans two tables, AbstractEntityPersister.update() will only execute the first and second statements. The update to subclass properties will not be executed.
The second statement will be omitted by replacing:
System.arraycopy( sqlUpdateStrings, 0, result, 1, getTableSpan() );
with:
if ( getTableSpan() > 1 ) {
System.arraycopy( sqlUpdateStrings, 1, result, 1, getTableSpan() - 1 );
}
Another problem cropped up when executing the test case that updates a NamedPoint. When an entity is read, the rowid is correct, but by the time the update is done, the rowid is somehow incremented and the query fails with "ORA-01410: invalid ROWID". In a test, I verified that the rowid was "AAAUlSAAEAAAAOkAAA" when the entity when read from the database, but the value that was bound to the prepared statement was "AAAUlTAAEAAAAe0AAA". After the test failed, the rowid in the database is still "AAAUlSAAEAAAAOkAAA". I have not figured out where or why the rowid is being modified, but it makes it impossible to use this optimization when the update spans more than one table.
I'll attach patches for AbstractEntityPersister and the updated test shortly.
Gail Badner
SourceLabs - http://www.sourcelabs.com
Dependable Open Source Systems
--
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, 8 months
[Hibernate-JIRA] Commented: (ANN-150) Consider higher level validations, such as email, URL, credit card, etc.
by Ted Bergeron (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/ANN-150?page=co... ]
Ted Bergeron commented on ANN-150:
----------------------------------
ISBN is very specific, and may not be necessary. I suggested it only because commons validator offered that. I think URL and URI would be useful. Really, the more validators that come out of the box, the more useful it is. Latitude and Longitude validators might be useful. In situations where developers tend to use basic types (String, Double, etc) to model more meaningful fields, such as Email, a validator pattern would be useful. A developer may use a coordinate class that has Lat/long/altitude, and may include the validation logic within. Alternatively, they may just use 2 Strings. If we think using a basic type is a common approach, ideally we'd have a validator for these cases.
> Consider higher level validations, such as email, URL, credit card, etc.
> ------------------------------------------------------------------------
>
> Key: ANN-150
> URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-150
> Project: Hibernate Annotations
> Issue Type: New Feature
> Components: validator
> Affects Versions: 3.1beta6
> Reporter: Ted Bergeron
> Priority: Minor
>
> I was looking at the release notes for commons validator 1.2 http://wiki.apache.org/jakarta-commons/ValidatorVersion120 and wondered if the higher level constructs fit the design goals of hibernate validator.
> They have email, URL, Credit card and ISBN. These could all be handled via @Pattern with regex matching a constant declared somewhere.
> Would it be desirable to have Hibernate supply the values for these constants? Such as:
> @Pattern(type="email") or @Pattern(regex=org.hibernate.validator.Pattern.EMAIL) or @Email
> Email and URL are global patterns. This probably wouldn't work for something like phone number which is locale sensitive.
--
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, 8 months
[Hibernate-JIRA] Commented: (ANN-150) Consider higher level validations, such as email, URL, credit card, etc.
by Diego Pires Plentz (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/ANN-150?page=co... ]
Diego Pires Plentz commented on ANN-150:
----------------------------------------
We already have @Email and @CreditCardNumber. Do you think that makes sense to add @ISBN and @URL to Validator?
> Consider higher level validations, such as email, URL, credit card, etc.
> ------------------------------------------------------------------------
>
> Key: ANN-150
> URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-150
> Project: Hibernate Annotations
> Issue Type: New Feature
> Components: validator
> Affects Versions: 3.1beta6
> Reporter: Ted Bergeron
> Priority: Minor
>
> I was looking at the release notes for commons validator 1.2 http://wiki.apache.org/jakarta-commons/ValidatorVersion120 and wondered if the higher level constructs fit the design goals of hibernate validator.
> They have email, URL, Credit card and ISBN. These could all be handled via @Pattern with regex matching a constant declared somewhere.
> Would it be desirable to have Hibernate supply the values for these constants? Such as:
> @Pattern(type="email") or @Pattern(regex=org.hibernate.validator.Pattern.EMAIL) or @Email
> Email and URL are global patterns. This probably wouldn't work for something like phone number which is locale sensitive.
--
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, 8 months
[Hibernate-JIRA] Commented: (HHH-1665) Assert the class for a Criteria is mapped
by Baptiste MATHUS (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1665?page=c... ]
Baptiste MATHUS commented on HHH-1665:
--------------------------------------
Completely agree with this report.
I just can't imagine the Hibernate team is not aware of this behaviour and that it was not made on purpose: isn't it to be able to handle polymorphism?
In fact, it's always very surprising when Hibernate doesn't say anything when you're actually trying to query a non mapped class, so it doesn't know which table to hit...
If made on purpose, I guess it'd be a good idea to document this a bit further and why it couldn't throw an exception, or at least issue a log.warn()...
Thanks a lot.
> Assert the class for a Criteria is mapped
> -----------------------------------------
>
> Key: HHH-1665
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1665
> Project: Hibernate3
> Issue Type: Improvement
> Components: query-criteria
> Affects Versions: 3.1.3
> Reporter: Daniel Campagnoli
> Priority: Minor
> Original Estimate: 5 minutes
> Remaining Estimate: 5 minutes
>
> In SessionImpl it would be handy if when getting the results for a criteria query it checked to see if the class is mapped and failed fast, as it currently silently returns an empty list. I ran into this problem because we have multiple session factories with different class mapped and from one DAO i tried to query a class that wasnt mapped in the SessionFactory being used. Could also happen if you accidently put the wrong class or added the wrong import for a class.
> SessionImpl.java
> public List list(CriteriaImpl criteria) throws HibernateException {
> errorIfClosed();
> checkTransactionSynchStatus();
> String[] implementors = factory.getImplementors( criteria.getEntityOrClassName() );
> int size = implementors.length;
> + if(size == 0)
> + throw new HibernateException(criteria.getEntityOrClassName() + " is not mapped");
--
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, 8 months
[Hibernate-JIRA] Created: (HHH-2560) Allow configuration of code page when mapping String to DB character data
by Greg Burcher (JIRA)
Allow configuration of code page when mapping String to DB character data
-------------------------------------------------------------------------
Key: HHH-2560
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2560
Project: Hibernate3
Issue Type: Improvement
Environment: All
Reporter: Greg Burcher
Priority: Minor
When instantiating mapped String properties from the database, Hibernate currently constructs String objects without specifying what code page to use with the byte values coming from the database. This assumes that the data in the database is encoded using the same code page as the default OS code page in the environment where java is running. This is not a valid assumption.
Hibernate should provide some way to configure the Session Factory with a default code page and/or a code page for specific String mapped properties. Maybe there is already a way to do this, but I have not found it.
The best work-around that I have currently found is to change the mapped property from String to byte[]. This avoids the Hibernate code that incorrectly converts the bytes to a String. However, I really want the interface of a String in my application, not a byte[], so I wrap the byte[] in a class that converts to/from String on demand. I also then need to create a UserType implementation and map to that UserType.
--
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, 8 months