Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Nested Embeddable bug?(Nested Embeddable with nul value)
Nested Embeddable bug? [message #1060293] Fri, 24 May 2013 00:05 Go to next message
Roger Spall is currently offline Roger SpallFriend
Messages: 17
Registered: January 2013
Junior Member
I have an Embeddable called Address which in turn contains an Embeddable called ZipCode. Finally I have an Entity called Contact which contains an Address.

	<embeddable access="FIELD" class="com.yamaha.ydsus.common.model.domain.ZipCode">
		<attributes>
			<basic name="zipCode"/>
		</attributes>
	</embeddable>
	<embeddable access="FIELD" class="com.yamaha.ydsus.common.model.domain.Address">
		<attributes>
			<basic name="street1"/>
			<basic name="city"/>
			<basic name="stateCode"/>
			<embedded name="zipCode"  attribute-type="com.yamaha.ydsus.common.model.domain.ZipCode"/>
		</attributes>
	</embeddable>
	<entity access="FIELD" class="com.yamaha.yds.model.domain.dealerprofile.DealerContactImpl">
		<table name="DEALER_CONTACT"/>
		<attributes>
			<id name="oid">
				<column name="OID"/>
				<generated-value generator="DEALER_CONTACT_SEQ" strategy="SEQUENCE"/>
				<sequence-generator allocation-size="1" name="DEALER_CONTACT_SEQ" sequence-name="DEALER_CONTACT_SEQ"/>
			</id>
			<basic name="email">
				<column name="EMAIL"/>
			</basic>
.... other fields and relationships
			<embedded name="address">
				<attribute-override name="zipCode.zipCode">
					<column name="ZIP"/>
				</attribute-override>
				<attribute-override name="street1">
					<column name="STREET_ADDRESS"/>
				</attribute-override>
				<attribute-override name="stateCode">
					<column name="STATE"/>
				</attribute-override>
				<attribute-override name="city">
					<column name="CITY"/>
				</attribute-override>
			</embedded>
		</attributes>
	</entity>


Anyway, with weaving turned on, whenever I create a new DealerContact with a new Address with a NULL ZipCode I get a null pointer exception when my SessionBean tries to commit / exit. Turning off weaving fixes the problem...

[Servlet Error]-[action]: javax.ejb.EJBException: nested exception is: java.lang.NullPointerException
java.lang.NullPointerException
	at org.eclipse.persistence.mappings.AggregateMapping.updateChangeRecord(AggregateMapping.java:908)
	at org.eclipse.persistence.mappings.AggregateMapping.updateChangeRecord(AggregateMapping.java:955)
	at org.eclipse.persistence.internal.descriptors.changetracking.AttributeChangeListener.internalPropertyChange(AttributeChangeListener.java:149)
	at org.eclipse.persistence.internal.descriptors.changetracking.AttributeChangeListener.propertyChange(AttributeChangeListener.java:111)
	at com.yamaha.ydsus.common.model.domain.dealerprofile.DealerContact._persistence_propertyChange(DealerContact.java)
	at com.yamaha.yds.model.domain.dealerprofile.DealerContactImpl._persistence_set_address(DealerContactImpl.java)
	at com.yamaha.yds.model.domain.dealerprofile.DealerContactImpl.setAddress(DealerContactImpl.java:167)
	at com.yamaha.yds.apps.dealerprofile.DealerProfileManagerBean.saveDealerContact(DealerProfileManagerBean.java:466)


This code was converted from Native Eclipselink / Toplink, and worked just fine with null ZipCodes. Of course, I can create a Null ZipCode object to get around the problem, but would like to understand if this is a bug, or something wrong with my mapping?

Just to be clear, our object model / database design expects null ZipCodes, so we would like to support this design.

From looking at the source code for the AggregateMapping class, it doesn't seem to expect nested embeddables to be null when using weaving for change management?

Eclipselink version 2.4.1.v20121003-ad44345

Many thanks,

Roger

[Updated on: Fri, 24 May 2013 00:08]

Report message to a moderator

Re: Nested Embeddable bug? [message #1060814 is a reply to message #1060293] Tue, 28 May 2013 13:44 Go to previous messageGo to next message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

Seems like a bug. Please try the latest release, and if it still occurs, please log a bug.


James : Wiki : Book : Blog : Twitter
Re: Nested Embeddable bug? [message #1066257 is a reply to message #1060814] Mon, 01 July 2013 17:52 Go to previous messageGo to next message
Michel Graciano is currently offline Michel GracianoFriend
Messages: 1
Registered: July 2013
Junior Member
Any news on this? I am facing similar issue and probably it is a bug. Have you already filed a bug about it?
Re: Nested Embeddable bug? [message #1066317 is a reply to message #1066257] Tue, 02 July 2013 07:21 Go to previous messageGo to next message
Reiner Lott is currently offline Reiner LottFriend
Messages: 7
Registered: April 2013
Junior Member
@Michael: The bug seems not to be filled - could you do this?

Cheers
Reiner
Re: Nested Embeddable bug? [message #1069910 is a reply to message #1066317] Tue, 16 July 2013 21:34 Go to previous message
Roger Spall is currently offline Roger SpallFriend
Messages: 17
Registered: January 2013
Junior Member
Ooopss...

Forgot to check back, and we worked around the bug.

I have now filed a bug report 413120 as I couldn't find an existing one from Michael Graciano.

Sorry for the delay.
Previous Topic:cascade-remove bug with UOW
Next Topic:Out of memory with level 2 cache enabled
Goto Forum:
  


Current Time: Fri Apr 19 19:58:11 GMT 2024

Powered by FUDForum. Page generated in 0.03193 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top