[Hibernate-JIRA] Created: (HHH-2287) Automatic mapping for bean properties.
by Marcos Silva Pereira (JIRA)
Automatic mapping for bean properties.
--------------------------------------
Key: HHH-2287
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2287
Project: Hibernate3
Type: Improvement
Components: metamodel, core
Versions: 3.2.2
Environment: Does not matter
Reporter: Marcos Silva Pereira
Priority: Trivial
Hibernate JPA support can mapping properties without an annotation, in other words, the properties are automatically mapped and, if I don't want to map some property, I must annotate it with the @Transient annotation.
I really think that automatic properties mapping could be a great enhancement to make XML mapping more simple. Per instance, if I have the following class (mapped using annotations):
@Entity
public class MyEntity {
@Id
private Long id;
// the properties below are mapped
// without annotations
private String name;
private String email;
private int age;
// gets, sets and other stuff.
}
The equivalent XML for this class would be:
<hibernate-mapping>
<class name="MyEntity" automatic-property-mapping="true">
<id name="id">
<generator class="native" />
</id>
</class>
</hibernate-mapping>
Sorry if it was duplicated but I can't found something like this here.
--
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
18 years
[Hibernate-JIRA] Closed: (HHH-1946) Query.iterate() results differ from Query.list().iterator()
by Steve Ebersole (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1946?page=all ]
Steve Ebersole closed HHH-1946:
-------------------------------
Resolution: Duplicate
the linked issue at least has the query causing the problem...
> Query.iterate() results differ from Query.list().iterator()
> -----------------------------------------------------------
>
> Key: HHH-1946
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1946
> Project: Hibernate3
> Type: Bug
> Components: query-hql
> Versions: 3.1.3
> Environment: Hibernate 3.1.3
> Sun JVM 1.5.0_06
> Windows XP
> Reporter: Simon Vos
> Priority: Critical
>
>
> While trying to migrate our code base from hibernate 2.1.8 to hibernate 3.1.3 I came across a weird problem. In one method a hibernate query is created to retrieve some results from the database, I know that there are three corresponding results in the database for this query. The code used for this is:
> rsIterator = query.iterate();
> while (rsIterator.hasNext()) {
> Relationship current = (Relationship) rsIterator.next();
> NaturalPerson person = (NaturalPerson) sess.get(NaturalPerson.class, new Niss(current.getSpouseNiss()).toLong());
> if (person != null) {
> current.setSpouseFirstName(person.getFirstName());
> current.setSpouseLastName(person.getLastName());
> } else
> log.info("No naturalPerson object could be retrieved for the person with niss number " + current.getSpouseNiss().toString());
> relations.add(current);
> }
> In hibernate 2.1.8 this method worked correctly and it added 3 results to the relations object. But while migrating one of my tests failed, because this method returned only 2 results. Then I tried using query.list().iterator() instead of query.iterate() and this gave me the correct three results..
--
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
18 years
[Hibernate-JIRA] Commented: (HHH-1480) Support new MySQL 5.0.12 join syntax
by Peter Lundberg (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1480?page=c... ]
Peter Lundberg commented on HHH-1480:
-------------------------------------
This issue also exists for Hibernate 2.1.6. A potential solution is to replace the ", " cross join operator with " JOIN " and accordingly filter the resulting from clause from leading " JOIN ". We are testing this approach as a bug-fix for our system, but more work is needed to get this properly into dialects etc.
> Support new MySQL 5.0.12 join syntax
> ------------------------------------
>
> Key: HHH-1480
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1480
> Project: Hibernate3
> Type: New Feature
> Components: query-sql
> Versions: 3.1.2
> Reporter: trebor iksrazal
>
>
> http://dev.mysql.com/doc/refman/5.0/en/join.html
> "Beginning with MySQL 5.0.12, natural joins and joins with USING, including outer join variants, are processed according to the SQL:2003 standard. These changes make MySQL more compliant with standard SQL. However, they can result in different output columns for some joins. Also, some queries that appeared to work correctly in older versions must be rewritten to comply with the standard. The following list provides more detail about several effects of the 5.0.12 change in join processing. The term "previously" means "prior to MySQL 5.0.12."
> Using 5.0.18 and hibernate 3.1.2, hibernate is not producing the correct join syntax for the latest versions of mysql.
> For example:
> FROM tableA AS A, tableB AS B INNER JOIN tableC AS C ON A.field1 =
> C.field2
> The above fails, because the B JOIN C is evaluated before the A alias has
> been created.
> The solution is to use parentheses to force an order of evaluation:
> FROM (tableA AS A, tableB AS B) INNER JOIN tableC AS C ON A.field1 =
> C.field2
--
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
18 years
[Hibernate-JIRA] Commented: (HHH-1) Optimize Hibernate for the bulk insertion of related entities
by Martin Ross (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1?page=comm... ]
Martin Ross commented on HHH-1:
-------------------------------
Here is what I have thus far... There is some other boring code that setups the insertActionMap but it isn't really relevant here...
public int compareTo(Object other)
{
if (other == this)
return 0;
if (visited.containsKey(other) && visited.get(other)!=null)
return (Integer)visited.get(other);
else if(visited.containsKey(other) && visited.get(other)==null)
return NORESULTYET;
else
// Indicate that we are in the process of currently visiting
visited.put(other, null);
final EntityInsertAction otherEntityInsertAction = ((EntityInsertAction) other);
final Object otherInstance = otherEntityInsertAction.getInstance();
int result = NORESULTYET;
if (otherInstance != getInstance())
{
// if any of our properties is actually to be inserted, it has to be before us
for (int i = 0; (result ==NORESULTYET) && i < state.length; i++)
{
final Object thisRelation = state[i];
if (thisRelation == otherInstance)
result = 1;
else
{
// 'this' has a relation to another 'related' object. 'related' must be definitely before 'this'.
EntityInsertAction related = (EntityInsertAction)insertActionMap.get(thisRelation);
if (related != null && related!=this) // lets see if other is a parent of related and thus a parent of this
{
// Case 1 - otherEntityInsertAction.compareTo(related) returns 1 => other is a parent of related => this should return -1
// Case 2 - otherEntityInsertAction.compareTo(related) returns -1 => other is a child of related => this should return
// Case 3 - other has no connection to related - related.compareTo should return 0
// In case 2 and 3 we should continue onwards
int recursiveResult = otherEntityInsertAction.compareTo(related);
if (recursiveResult!=NORESULTYET && recursiveResult < 0)
result = -1;
}
}
}
// Check if other has a bidrectional relationship to this
// Basically the reverse of the previous logic
for (int i = 0; (result ==NORESULTYET) && i < otherEntityInsertAction.state.length; i++)
{
final Object otherRel = otherEntityInsertAction.state[i];
if (otherRel == this.getInstance())
result = -1;
else
{
EntityInsertAction related = (EntityInsertAction)insertActionMap.get(otherRel);
if (related != null && related!=this)
{
int recursiveResult = this.compareTo(related);
if (recursiveResult!=NORESULTYET && recursiveResult < 0)
result = -1;
}
}
}
}
if (result==NORESULTYET)
result = super.compareTo(other);
visited.put(other, Integer.valueOf(result));
return result;
}
But basically I can't seem to get the recurrence relation to work properly.....
e.g.
if (recursiveResult!=NORESULTYET && recursiveResult < 0)
result = -1;
> Optimize Hibernate for the bulk insertion of related entities
> -------------------------------------------------------------
>
> Key: HHH-1
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1
> Project: Hibernate3
> Type: New Feature
> Components: core
> Environment: Hibernate 1.2, MySql 3.1
> Reporter: Bradley Leupen
> Priority: Minor
>
>
> It is currently difficult to batch the creation of persistent entities that maintain associations with other entities.
> Add necessary api to hibernate to support the save or update of a collection of entities. An optimization can be applied in this scenario to group inserts / updates by entity class, or table. This will enable the hibernate engine to utilize batching if available, drastically improving performance over a network.
--
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
18 years