Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] Value of DiscriminatorValue not persisted

I have a model which uses inheritance-type=SINGLE_TABLE:
 
@Entity
@Table(name = "origo_email_part")
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "part_type", discriminatorType = DiscriminatorType.STRING)
@SequenceGenerator(name = "EmailPartSEQ_STORE", sequenceName = "origo_email_part_entity_id_seq", allocationSize = 1)
@Cacheable
abstract class EmailPart
@Entity
@DiscriminatorValue("singlepart")
class EmailSinglePart (_uid: String, _charSet: Option[String], _stringContent: Option[String],
                      _mimeType: Option[String], _data: Blob, _fileName: Option[String])
        extends EmailPart
And persisting it results in:
 
LOG:  execute 0000000000000053: INSERT INTO origo_email_part (entity_id, part_index, uid, VERSION, message_id, parent_id, part_type) VALUES ($1, $2, $3, $4, $5, $6, $7)
DETAIL:  parameters: $1 = '286417', $2 = '1', $3 = '6a753912-f3cf-4daa-ba7a-3cac62526448', $4 = '1', $5 = '402439', $6 = NULL, $7 = NULL
ERROR:  null value in column "part_type" violates not-null constraint
 
Doesn't EL persist the value of the discriminator-column? Do I have to map it as a explicit column-value?
 
Thanks.
 
--
Andreas Joseph Krogh <andreak@xxxxxxxxxxxx>      mob: +47 909 56 963
Senior Software Developer / CTO - OfficeNet AS - http://www.officenet.no
Public key: http://home.officenet.no/~andreak/public_key.asc

Back to the top