db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matthew Baird" <Matthew.Ba...@motiva.com>
Subject RE: State of the Union
Date Fri, 20 Dec 2002 21:40:03 GMT
public void set(Object anObject, Object aValue) throws MetadataException
	{
		Method m = getPropertyDescriptor().getWriteMethod();
		Object[] args = { aValue };

		if (m != null)
		{
			if (aValue != null)
			{
				try
				{
					m.invoke(anObject, args);
				}
				catch (Throwable e)
				{
					logProblem(anObject, aValue, e.getClass().getName());
					throw new MetadataException("Error invoking method:" + m.getName() + " in object:" +
anObject.getClass().getName(), e);
				}
			}
		}

there was no way to null out a reference since if aValue was null, the method was not invoked.
Can't imagine why we wouldn't allow this. Anyway, the fix has been tested and checked in,
so people using the propertyPersistentField will not see any wierdness.




-----Original Message-----
From: Thomas Mahler [mailto:thma@apache.org]
Sent: Friday, December 20, 2002 8:39 AM
To: OJB Developers List
Subject: Re: State of the Union


hi again,

Matthew Baird wrote:
> Hi Thomas,
>  
> would you expect the results to be the same if getters and setters existed for all the
mapped fields?
> 

yes !


> 	-----Original Message----- 
> 	From: Thomas Mahler [mailto:thma@apache.org] 
> 	Sent: Thu 12/19/2002 10:16 PM 
> 	To: OJB Developers List 
> 	Cc: 
> 	Subject: Re: State of the Union
> 	
> 	
> 
> 	Hi Matthew,
> 	
> 	I did not look into this special case, but we had similar problems
> 	before. Most times problems arise because developers forget to write
> 	testcases that work for all PersistentField implementations.
> 	
> 	With PersistentFieldDefaultImpl entity classes are not required to have
> 	getters and setters for atttributes.
> 	A test-case accessing this attribute with the
> 	PersistentFieldPropertyImpl will fail!
> 	
> 	cheers,
> 	Thomas
> 	
> 	
> 	Matthew Baird wrote:
> 	> with PersistentFieldDefaultImpl
> 	>
> 	> junit-no-compile-no-prepare:
> 	>     [junit] Running org.apache.ojb.broker.AllTests
> 	>     [junit] [BOOT] INFO: OJB.properties: file:/C:/eclipse/workspace/jakarta-ojb/target/test/ojb/OJB.properties
> 	>     [junit] Tests run: 163, Failures: 1, Errors: 0, Time elapsed: 9.281 sec
> 	>     [junit] TEST org.apache.ojb.broker.AllTests FAILED
> 	>     [junit] Running org.apache.ojb.odmg.AllTests
> 	>     [junit] [BOOT] INFO: OJB.properties: file:/C:/eclipse/workspace/jakarta-ojb/target/test/ojb/OJB.properties
> 	>     [junit] Tests run: 144, Failures: 0, Errors: 2, Time elapsed: 13.156 sec
> 	>     [junit] TEST org.apache.ojb.odmg.AllTests FAILED
> 	>     [junit] Running org.apache.ojb.soda.AllTests
> 	>     [junit] [BOOT] INFO: OJB.properties: file:/C:/eclipse/workspace/jakarta-ojb/target/test/ojb/OJB.properties
> 	>     [junit] Tests run: 3, Failures: 3, Errors: 0, Time elapsed: 4.437 sec
> 	>     [junit] TEST org.apache.ojb.soda.AllTests FAILED
> 	>
> 	> with PersistentFieldPropertyImpl
> 	>
> 	> junit-no-compile-no-prepare:
> 	>     [junit] Running org.apache.ojb.broker.AllTests
> 	>     [junit] [BOOT] INFO: OJB.properties: file:/C:/eclipse/workspace/jakarta-ojb/target/test/ojb/OJB.properties
> 	>     [junit] Tests run: 163, Failures: 2, Errors: 2, Time elapsed: 9.281 sec
> 	>     [junit] TEST org.apache.ojb.broker.AllTests FAILED
> 	>     [junit] Running org.apache.ojb.odmg.AllTests
> 	>     [junit] [BOOT] INFO: OJB.properties: file:/C:/eclipse/workspace/jakarta-ojb/target/test/ojb/OJB.properties
> 	>     [junit] Tests run: 144, Failures: 0, Errors: 5, Time elapsed: 13.156 sec
> 	>     [junit] TEST org.apache.ojb.odmg.AllTests FAILED
> 	>     [junit] Running org.apache.ojb.soda.AllTests
> 	>     [junit] [BOOT] INFO: OJB.properties: file:/C:/eclipse/workspace/jakarta-ojb/target/test/ojb/OJB.properties
> 	>     [junit] Tests run: 3, Failures: 3, Errors: 0, Time elapsed: 4.437 sec
> 	>     [junit] TEST org.apache.ojb.soda.AllTests FAILED
> 	>
> 	> I'm curious as to why these results are different?
> 	>
> 	> [org.apache.ojb.broker.accesslayer.JdbcAccess] ERROR: SQLException during the execution
of the delete (for a org.apache.ojb.broker.BidirectionalAssociationObjectA): Integrity constraint
violation: BIDIR_B_FK_1 table: BIDIR_B in statement [DELETE FROM BIDIR_A WHERE pk = 'A1040350973596'
]
> 	> Integrity constraint violation: BIDIR_B_FK_1 table: BIDIR_B in statement [DELETE
FROM BIDIR_A WHERE pk = 'A1040350973596' ]
> 	>
> 	> seems to be mostly related to the bidirectional association tests.
> 	>
> 	> I'm looking into it, but would appreciate any help
> 	>
> 	> --
> 	> To unsubscribe, e-mail:   <mailto:ojb-dev-unsubscribe@jakarta.apache.org>
> 	> For additional commands, e-mail: <mailto:ojb-dev-help@jakarta.apache.org>
> 	>
> 	>
> 	>
> 	>
> 	
> 	
> 	
> 	--
> 	To unsubscribe, e-mail:   <mailto:ojb-dev-unsubscribe@jakarta.apache.org>
> 	For additional commands, e-mail: <mailto:ojb-dev-help@jakarta.apache.org>
> 	
> 	
> 
> 
> 
> ------------------------------------------------------------------------
> 
> --
> To unsubscribe, e-mail:   <mailto:ojb-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:ojb-dev-help@jakarta.apache.org>



--
To unsubscribe, e-mail:   <mailto:ojb-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ojb-dev-help@jakarta.apache.org>

Mime
View raw message