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