Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Cannot add non-johm annotations to @Id field #31

hertzsprung opened this Issue Jan 26, 2011 · 4 comments


None yet
3 participants

Using JOhm 0.5.0
Test case:
public @interface TestAnnotation {}

public class MyEntity {
    @Id @TestAnnotation private Integer id;
    // etc ...

Trying to save the entity gives the exception:
redis.clients.johm.JOhmException: Element annotated @id cannot have any other annotations
at redis.clients.johm.JOhmUtils$Validator.checkValidIdType(JOhmUtils.java:323)

This seems to be related to issue #16 (0999132)


gsharma commented Jan 26, 2011

Yeah, let me fix this. I think we need to do a better job of the fix for Issue 16 and ignore all JOhm-specific annotations other than the Id on id field. The patch I put in blindly ignores every other annotation but @id.


gsharma commented Jan 28, 2011

Pushed a fix on my master; will wait for the prior pull-request to be merged to make another pull-request for this patch.

In case you want to use the patched version right away, please feel free to clone my repo: https://github.com/gsharma/johm


xetorthio commented Jan 30, 2011

done, pushed to master

dpoldrugo pushed a commit to dpoldrugo/johm that referenced this issue Apr 20, 2016

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment