Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Embedded object with null values in db cause instances not to be updated(Embedded object with null values in db cause instances not to be updated)
Embedded object with null values in db cause instances not to be updated [message #784079] Fri, 27 January 2012 03:13
Mark Ashworth is currently offline Mark AshworthFriend
Messages: 40
Registered: January 2012
Member
Hi,

The behaviour that I am experiencing with EclipseLink 2.3.1, Glassfish 3.1.2b16, SQL Server 2008 R2 is that if an embedded object has null values in the database, this prevents the update of the containing entity.

So for example, I have an embeddable class called `Contact` which I embedded into the `TrainingCourse` entity. Now when ever I perform an EntityManager.merge call on an training course instance where the contact details is null then there are no updates to the database and the log level ALL for EclipseLink does not hint at a problem.

NOTE: This worked in a previous release of EclipseLink, I think it was 2.2.x

@Embeddable
public class Contact implements Serializable {

    @Column(name = "contact_name")
    private String name;

    @Column(name = "contact_telephone_no")
    private String telephoneNo;




@Embedded
@AttributeOverrides({
	@AttributeOverride(name = "name", column = @Column(name = "course_contact_person")),
	@AttributeOverride(name = "telephoneNo", column = @Column(name = "course_contact_no"))
})
private Contact contact;



CREATE TABLE [cde].[course](
	[course_id] [bigint] IDENTITY(1,1) NOT NULL,
	[course_duration] [int] NOT NULL,
	[course_duration_type_id] [int] NOT NULL,
	[training_provider_id] [bigint] NOT NULL,
	[course_accrediting_body] [varchar](64) NULL,
	[course_title] [varchar](64) NOT NULL,
	[course_overview] [varchar](256) NULL,
	[course_contact_person] [varchar](64) NULL,
	[course_contact_no] [varchar](24) NULL,
	[course_internal] [bit] NULL,
	[course_core] [bit] NULL,
	[skill_area_id] [int] NULL,
	[content_type_id] [bigint] NULL,
	[course_category_id] [bigint] NULL,
	[create_ts] [datetime] NULL,
	[update_ts] [datetime] NULL,
	[version] [int] NULL,
	[archived] [bit] NULL)


Regards,
Mark P Ashworth

[Updated on: Fri, 27 January 2012 03:20]

Report message to a moderator

Previous Topic:Retrieve storedprocedure messages using JPA
Next Topic:Composite Key Configuration using Dynamic Eclipse Link API
Goto Forum:
  


Current Time: Sun Nov 03 04:42:27 GMT 2024

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

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

Back to the top