gora-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lewis John McGibbney (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GORA-189) Embrace all text-like parameters in generated Persistent subclasses by Compiler CharSequence
Date Tue, 29 Jul 2014 20:54:44 GMT

    [ https://issues.apache.org/jira/browse/GORA-189?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14078339#comment-14078339
] 

Lewis John McGibbney commented on GORA-189:
-------------------------------------------

[~alfonso.nishikawa], I recently ran into this when attempting to populate a CharSequence
field with a String and also Utf8. 
I think an improvement upon your patch as above (over and above thr fact that your patch was
made for the Old GoraCompiler) is that we should be able to pass in ANY String, Utf8, and
other text-like data type's and they should be wrapped as ByteBuffer. If we do not do this,
we experience ClassCassException as follows

569 [main] INFO org.apache.gora.solr.store.SolrStore - Using HttpSolrServer Solrj implementation.
7630 [main] INFO gov.nasa.jpl.xdata.nba.impoexpo.parse.ParseUtil - Parsing Text: /usr/local/xdata-nba-1/impoexpo/src/main/resources/0021300632_preview.txt
Exception in thread "main" java.lang.ClassCastException: java.lang.String cannot be cast to
java.nio.ByteBuffer
	at org.apache.gora.persistency.impl.PersistentBase.getDirtyBytes(PersistentBase.java:176)
	at org.apache.gora.persistency.impl.PersistentBase.setDirty(PersistentBase.java:161)
	at gov.nasa.jpl.xdata.nba.impoexpo.structs.Preview.setPreviewText(Preview.java:95)
	at gov.nasa.jpl.xdata.nba.impoexpo.parse.ParseUtil.parsePreview(ParseUtil.java:79)
	at gov.nasa.jpl.xdata.nba.impoexpo.manager.GameManager.aquire(GameManager.java:149)
	at gov.nasa.jpl.xdata.nba.impoexpo.manager.GameManager.main(GameManager.java:90)

This 

> Embrace all text-like parameters in generated Persistent subclasses by Compiler CharSequence
> --------------------------------------------------------------------------------------------
>
>                 Key: GORA-189
>                 URL: https://issues.apache.org/jira/browse/GORA-189
>             Project: Apache Gora
>          Issue Type: Improvement
>          Components: gora-core
>    Affects Versions: 0.2.1
>            Reporter: Alfonso Nishikawa
>            Assignee: Alfonso Nishikawa
>            Priority: Trivial
>             Fix For: 0.5
>
>         Attachments: GORA-189.patch
>
>
> It would be much useful if gora compiler generates methods taking Strings as parameters
(and creating Utf8 inside automatically). Code would be much more clear and simple when populating
that classes.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message