After further investigation I found that it has nothing to do with the
ElementCollection or PersistentCollection.
The mapping that was working simply was erroneously leaving out the
problematic column.

I fixed the annotation so it's now as follows:
    @javax.persistence.CollectionTable(
        name="Movie_image",
        joinColumns=@javax.persistence.JoinColumn(name="Movie_fk"))
        @javax.persistence.ElementCollection(targetClass=java.lang.String.class)
        @javax.persistence.Lob
        public java.util.Collection<org.openanzo.rdf.URI> getImage() throws
org.openanzo.rdf.jastor.JastorException {

The table is now being created correctly but at runtime I'm getting a
ClassCastException at line 1300 in DBDictionary

                    setClobString(stmnt, idx, (String) val, col);

val is an instance of org.openanzo.rdf.URI which I passed into openjpa
config with:

        jpaConf.put("openjpa.jdbc.MappingDefaults",
"ForeignKeyDeleteAction=restrict,JoinForeignKeyDeleteAction=restrict,FieldStrategies='"
+ Duration.class.getName() + "=" + DurationValueHandler.class.getName() +
"," + URI.class.getName() + "=" + URIValueHandler.class.getName() + "'");

But I can't seem to find where in the code it's supposed to apply that value
URIValueHandler to create val which could then be cast to a String. 

If anyone has any ideas it would be greatly appreciated.



--
View this message in context: 
http://openjpa.208410.n2.nabble.com/javax-persistence-ElementCollection-instead-of-org-apache-openjpa-persistence-PersistentCollection-In-tp7580963p7580990.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Reply via email to