Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
hertzsprung opened this issue Jan 26, 2011 · 4 comments
Closed

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

hertzsprung opened this issue Jan 26, 2011 · 4 comments

Comments

@hertzsprung
Copy link

Using JOhm 0.5.0
Test case:
@retention(RetentionPolicy.RUNTIME)
@target(ElementType.FIELD)
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)

@hertzsprung
Copy link
Author

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

@gsharma
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Owner

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants