Home » Eclipse Projects » EclipseLink » Customizer for VARRAY column
Customizer for VARRAY column [message #1854831] |
Tue, 13 September 2022 18:44 |
Dave Brosius Messages: 36 Registered: July 2009 |
Member |
|
|
I have a VARRAY type defined as
create or replace TYPE STORAGE_DIRECTIVES AS VARRAY(10) OF varchar2(255 char);
and a table using such as
CREATE TABLE "FSS_CLOB_VIEW"
( "LOB_ID" NUMBER(18,0),
"FILE_NAME" VARCHAR2(255 CHAR),
"DIRECTIVES" "STORAGE_DIRECTIVES" ,
"LOB_DATA" CLOB,
) ;
Trying to map that to a List<String> in jpa, such as
@Override
@Column(name = "DIRECTIVES", nullable = true, unique = false)
public List<String> getDirectives() {
return directives;
}
Now i assume i need to add a
@Customizer(StorageDirectivesCustomizer.class)
to this entity,which i have done,and the customizer looks like
public class StorageDirectivesCustomizer implements DescriptorCustomizer {
@Override
public void customize(ClassDescriptor descriptor) throws Exception {
ObjectArrayMapping arrayMapping = new ObjectArrayMapping();
arrayMapping.setReferenceClass(String.class);
arrayMapping.setAttributeName("directives");
arrayMapping.setFieldName("directives");
arrayMapping.setStructureName("STORAGE_DIRECTIVES");
descriptor.addMapping(arrayMapping);
}
}
However when i run, i get
[java] Exception Description: Descriptor is missing for class [java.lang.String].
[java] Mapping: org.eclipse.persistence.mappings.structures.ObjectArrayMapping[directives]
[java] Descriptor: RelationalDescriptor(com.oracle.cegbu.filestore.extschema.jpa.entity.DatabaseStorageClobTableEO --> [DatabaseTable(FSS_CLOB_VIEW)])
Can someone enlighten me on what i'm doing wrong?
|
|
| |
Re: Customizer for VARRAY column [message #1854850 is a reply to message #1854842] |
Wed, 14 September 2022 14:01 |
Dave Brosius Messages: 36 Registered: July 2009 |
Member |
|
|
Thanks for the response, when i annotate the getter, like
@Override
@org.eclipse.persistence.annotations.Array(targetClass = String.class, databaseType = "STORAGE_DIRECTIVES")
@Column(name = "DIRECTIVES", nullable = true, unique = false)
public List<String> getDirectives() {
return directives;
}
i get the exception
[java] Caused by: org.eclipse.persistence.exceptions.DescriptorException:
[java] Exception Description: Normal descriptors do not support non-relational extensions.
[java] Descriptor: RelationalDescriptor(com.oracle.cegbu.filestore.extschema.jpa.entity.DatabaseStorageClobTableEO --> [DatabaseTable(FSS_CLOB_VIEW)])
I see in the supplied examples, it is applied to the field, so when i move to
@org.eclipse.persistence.annotations.Array(targetClass = String.class, databaseType = "STORAGE_DIRECTIVES")
@Column(name = "DIRECTIVES", nullable = true, unique = false)
private List<String> directives;
i get the exception
[java] Caused by: java.sql.SQLException: ORA-00600: internal error code, arguments: [xtyDSTprimsec], [], [], [], [], [], [], [], [], [], [], []
[Updated on: Wed, 14 September 2022 14:45] Report message to a moderator
|
|
| |
Goto Forum:
Current Time: Mon Dec 09 04:25:24 GMT 2024
Powered by FUDForum. Page generated in 0.03258 seconds
|