Re: [Fwd: RE: [Hibernate] @Fetch]
Hi, I don't fully understand you. My plan was to add at least org.hibernate.annotations.Lazy and org.hibernate.annotations.Fetch They will keep the standard/extension separation clean. Emmanuel Bernard wrote: Original Message Subject: RE: [Hibernate] @Fetch Date: Mon, 13 Mar 2006 15:12:44 +1000 From: dchannon [EMAIL PROTECTED] To: 'Emmanuel Bernard' [EMAIL PROTECTED] I feel its best not to confuse what is within the standard and what is an extension. So far you have been able to do that clearly with the extension annotations so I would continue Along those lines. No I do accept its not as clean as if you threw it all into the optional parameter for same Annotation but the separation, I feel, is more important. My 2cents. Cheers David. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Emmanuel Bernard Sent: Monday, 13 March 2006 8:20 AM To: Hibernate development Subject: Re: [Hibernate] @Fetch Actually @Lazy has the same issue TRUE, FALSE, PROXY, NO-PROXY, EXTRA @Fetch SELECT, JOIN, SUBSELECT Emmanuel Bernard wrote: I'll add a @Fetch annotation Some FetchType are available on collections only, some on single association only. Do you think I should have 2 different @Fetch annotations (one for each), or should I mix all FetchType in one single annotation? Thoughts? --- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642 ___ hibernate-devel mailing list hibernate-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hibernate-devel --- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642 ___ hibernate-devel mailing list hibernate-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hibernate-devel --- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642 ___ hibernate-devel mailing list hibernate-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hibernate-devel --- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642 ___ hibernate-devel mailing list hibernate-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hibernate-devel
[Hibernate] hibernate-hsqldb-testsuite Build Completed With Testsuite Errors
View results here -> http://cruisecontrol.jboss.com/cc/buildresults/hibernate-hsqldb-testsuite?log=log20060313123337 TESTS FAILEDAnt Error Message:/home/cruisecontrol/work/scripts/build-hibernate-db-matrix.xml:84: The following error occurred while executing this line: /home/cruisecontrol/work/scripts/build-hibernate-db-matrix.xml:75: The following error occurred while executing this line: /home/cruisecontrol/work/scripts/build-common-targets.xml:11: Build Successful - Tests completed with errors or failures.Date of build:03/13/2006 12:33:37Time to build:11 minutes 1 second Unit Tests: (813) Total Errors and Failures: (8)testReturnPropertyComponentRenameorg.hibernate.test.legacy.SQLLoaderTesttestReadOnlyOnProxiesFailureExpectedorg.hibernate.test.readonly.ReadOnlyTesttestEmptyInListFailureExpectedorg.hibernate.test.hql.HQLTesttestMaxindexHqlFunctionInElementAccessorFailureExpectedorg.hibernate.test.hql.HQLTesttestMultipleElementAccessorOperatorsFailureExpectedorg.hibernate.test.hql.HQLTesttestKeyManyToOneJoinFailureExpectedorg.hibernate.test.hql.HQLTesttestDuplicateExplicitJoinFailureExpectedorg.hibernate.test.hql.HQLTesttestCollectionFetchVsLoadorg.hibernate.test.stats.StatsTest Modifications since last build:(first 50 of 0)
Re: [Hibernate] Componets equals null
I was trying to write it as UserType. But I couldn't obtain the same functionality that I have with a hibernate component, because I find no way to implement an UserType that some of his properties be part of a manytoone or onetomany relation. Pablo Max Rydahl Andersen wrote: On Fri, 10 Mar 2006 20:44:14 +0100, Pablo Nussembaum [EMAIL PROTECTED] wrote: I know that, but this a common glitch that some hibernate users complains. I think that this behavior is more natural to final user as its follow the minimal surprise concept. Why if the component has all nulls properties and in the db all the fields were null, hibernate generates and update? This is the problem, none of the solutions will be symmetric. Hibernate chooses that a null value means null in the db and vice versa. You can write a custom user type if you want a behavior that instantiates a component with null values instead. /max Pablo Nussembaum Emmanuel Bernard wrote: you should probably use a UserType to code such application semantic. Pablo Nussembaum wrote: Hi, I made a simple modification in the ComponentType class to consider null component equals to a components with all his properties nulls. I do this to address 2 problems I have: 1. For simplicity in all entities, when a components is null the getters builds a new instance and then returning it. But with this pattern hibernate detects this entities dirty and generates updates to the db that aren't need. 2. I have a very long process where I traverse a long dataset make some computations and generates very few result. This process always generates OutofMemory exception because hibernate detects to many dirty entities (one solution it to flush the session often, but I don't want to update the entity and the process with the spurious updates is slower) --- Some code to explain better: /** * return the properties' values if the components != null, or and array of null values. */ private Object[] getPropertyValuesArray(Object component, EntityMode entityMode) { if (component == null) { return new Object[propertyTypes.length]; } else { return getPropertyValues(component, entityMode); } } /** * And somethig similar for isDirty, isSame */ public boolean isEqual(Object x, Object y, EntityMode entityMode) throws HibernateException { if ( x == y ) return true; //if ( x == null || y == null ) return false; Object[] xvalues = getPropertyValuesArray(x, entityMode); Object[] yvalues = getPropertyValuesArray(y, entityMode); for ( int i = 0; i propertySpan; i++ ) { if ( !propertyTypes[i].isEqual( xvalues[i], yvalues[i], entityMode ) ) return false; } return true; } --- Regars, //$Id: ComponentType.java,v 1.37 2005/07/29 05:36:14 oneovthafew Exp $ package org.hibernate.type; import java.io.Serializable; import java.lang.reflect.Method; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.HashMap; import java.util.Map; import org.dom4j.Element; import org.dom4j.Node; import org.hibernate.EntityMode; import org.hibernate.FetchMode; import org.hibernate.HibernateException; import org.hibernate.MappingException; import org.hibernate.engine.CascadeStyle; import org.hibernate.engine.Mapping; import org.hibernate.engine.SessionFactoryImplementor; import org.hibernate.engine.SessionImplementor; import org.hibernate.tuple.ComponentTuplizer; import org.hibernate.tuple.TuplizerLookup; import org.hibernate.util.ArrayHelper; import org.hibernate.util.StringHelper; /** * Handles component mappings * * @author Gavin King */ public class ComponentType extends AbstractType implements AbstractComponentType { private final Type[] propertyTypes; private final String[] propertyNames; private final boolean[] propertyNullability; protected final int propertySpan; private final CascadeStyle[] cascade; private final FetchMode[] joinedFetch; private final boolean isKey; protected TuplizerLookup tuplizers; public int[] sqlTypes(Mapping mapping) throws MappingException { //Not called at runtime so doesn't matter if its slow :) int[] sqlTypes = new int[getColumnSpan( mapping )]; int n = 0; for ( int i = 0; i propertySpan; i++ ) { int[] subtypes = propertyTypes[i].sqlTypes( mapping ); for ( int j = 0; j subtypes.length; j++ ) { sqlTypes[n++] = subtypes[j]; } } return sqlTypes; } public int getColumnSpan(Mapping mapping) throws MappingException { int span = 0; for ( int i = 0; i propertySpan; i++ ) { span += propertyTypes[i].getColumnSpan( mapping );
[Hibernate] hibernate-mysql-testsuite Build Completed With Testsuite Errors
View results here -> http://cruisecontrol.jboss.com/cc/buildresults/hibernate-mysql-testsuite?log=log20060313134702 TESTS FAILEDAnt Error Message:/home/cruisecontrol/work/scripts/build-hibernate-db-matrix.xml:119: The following error occurred while executing this line: /home/cruisecontrol/work/scripts/build-hibernate-db-matrix.xml:75: The following error occurred while executing this line: /home/cruisecontrol/work/scripts/build-common-targets.xml:11: Build Successful - Tests completed with errors or failures.Date of build:03/13/2006 13:47:02Time to build:44 minutes 0 seconds Unit Tests: (811) Total Errors and Failures: (18)testStaleVersionedInstanceFoundInQueryResultorg.hibernate.test.ejb3.lock.RepeatableReadTesttestStaleVersionedInstanceFoundOnLockorg.hibernate.test.ejb3.lock.RepeatableReadTesttestUpdateWithWhereExistsSubqueryorg.hibernate.test.hql.BulkManipulationTesttestQueryorg.hibernate.test.legacy.FooBarTesttestOneToOneGeneratororg.hibernate.test.legacy.FooBarTesttestReachabilityorg.hibernate.test.legacy.FooBarTesttestVersionedCollectionsorg.hibernate.test.legacy.FooBarTesttestReturnPropertyComponentRenameorg.hibernate.test.legacy.SQLLoaderTesttestReadOnlyOnProxiesFailureExpectedorg.hibernate.test.readonly.ReadOnlyTesttestScalarStoredProcedureorg.hibernate.test.sql.MySQLTesttestParameterHandlingorg.hibernate.test.sql.MySQLTesttestEntityStoredProcedureorg.hibernate.test.sql.MySQLTesttestEmptyInListFailureExpectedorg.hibernate.test.hql.HQLTesttestMaxindexHqlFunctionInElementAccessorFailureExpectedorg.hibernate.test.hql.HQLTesttestMultipleElementAccessorOperatorsFailureExpectedorg.hibernate.test.hql.HQLTesttestKeyManyToOneJoinFailureExpectedorg.hibernate.test.hql.HQLTesttestDuplicateExplicitJoinFailureExpectedorg.hibernate.test.hql.HQLTesttestCollectionFetchVsLoadorg.hibernate.test.stats.StatsTest Modifications since last build:(first 50 of 0)
[Hibernate] hibernate-oracle10-testsuite Build Completed With Testsuite Errors
View results here -> http://cruisecontrol.jboss.com/cc/buildresults/hibernate-oracle10-testsuite?log=log20060313143138 TESTS FAILEDAnt Error Message:/home/cruisecontrol/work/scripts/build-hibernate-db-matrix.xml:98: The following error occurred while executing this line: /home/cruisecontrol/work/scripts/build-hibernate-db-matrix.xml:75: The following error occurred while executing this line: /home/cruisecontrol/work/scripts/build-common-targets.xml:11: Build Successful - Tests completed with errors or failures.Date of build:03/13/2006 14:31:38Time to build:16 minutes 53 seconds Unit Tests: (814) Total Errors and Failures: (9)testJDBC3GetGeneratedKeysSupportOnOracleorg.hibernate.test.generatedkeys.oracle.OracleGeneratedKeysTesttestReturnPropertyComponentRenameorg.hibernate.test.legacy.SQLLoaderTesttestReadOnlyOnProxiesFailureExpectedorg.hibernate.test.readonly.ReadOnlyTesttestEmptyInListFailureExpectedorg.hibernate.test.hql.HQLTesttestMaxindexHqlFunctionInElementAccessorFailureExpectedorg.hibernate.test.hql.HQLTesttestMultipleElementAccessorOperatorsFailureExpectedorg.hibernate.test.hql.HQLTesttestKeyManyToOneJoinFailureExpectedorg.hibernate.test.hql.HQLTesttestDuplicateExplicitJoinFailureExpectedorg.hibernate.test.hql.HQLTesttestCollectionFetchVsLoadorg.hibernate.test.stats.StatsTest Modifications since last build:(first 50 of 0)
RE: [Fwd: RE: [Hibernate] @Fetch]
OK this is what I would want to happen. +1 for completing the extensions to be much closer to what is available in the hbm mapping side. As far as separating Entity V Collection - Maybe should be separated to allow more accurate IDE auto complete and static compliation checking to occur. I have not looked at Java6 to see if validation of annotations will help in this area. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Emmanuel Bernard Sent: Monday, 13 March 2006 7:32 PM Cc: Hibernate development Subject: Re: [Fwd: RE: [Hibernate] @Fetch] Hi, I don't fully understand you. My plan was to add at least org.hibernate.annotations.Lazy and org.hibernate.annotations.Fetch They will keep the standard/extension separation clean. Emmanuel Bernard wrote: Original Message Subject: RE: [Hibernate] @Fetch Date: Mon, 13 Mar 2006 15:12:44 +1000 From: dchannon [EMAIL PROTECTED] To: 'Emmanuel Bernard' [EMAIL PROTECTED] I feel its best not to confuse what is within the standard and what is an extension. So far you have been able to do that clearly with the extension annotations so I would continue Along those lines. No I do accept its not as clean as if you threw it all into the optional parameter for same Annotation but the separation, I feel, is more important. My 2cents. Cheers David. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Emmanuel Bernard Sent: Monday, 13 March 2006 8:20 AM To: Hibernate development Subject: Re: [Hibernate] @Fetch Actually @Lazy has the same issue TRUE, FALSE, PROXY, NO-PROXY, EXTRA @Fetch SELECT, JOIN, SUBSELECT Emmanuel Bernard wrote: I'll add a @Fetch annotation Some FetchType are available on collections only, some on single association only. Do you think I should have 2 different @Fetch annotations (one for each), or should I mix all FetchType in one single annotation? Thoughts? --- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=1216 42 ___ hibernate-devel mailing list hibernate-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hibernate-devel --- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642 ___ hibernate-devel mailing list hibernate-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hibernate-devel --- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642 ___ hibernate-devel mailing list hibernate-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hibernate-devel --- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642 ___ hibernate-devel mailing list hibernate-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hibernate-devel --- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642 ___ hibernate-devel mailing list hibernate-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hibernate-devel