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

Getting error redis.clients.johm.JOhmException: java.lang.IllegalArgumentException: Can not set java.lang.Long field User.id to java.lang.Integer #44

Open
jeserkin opened this issue Sep 16, 2011 · 3 comments

Comments

@jeserkin
Copy link

Getting such error redis.clients.johm.JOhmException: java.lang.IllegalArgumentException: Can not set java.lang.Long field User.id to java.lang.Integer. Did everything as it was described in example. Might that be a bug in 0.5.0 version?

public class Test
{
    public static void main( String[] args )
    {
        // Jedis use
        JedisPool jedisPool = new JedisPool( new Config(), "localhost" );
        JOhm.setPool( jedisPool );

        User user1 = new User();

        user1.setName( "Jhon" );
        user1.setAge( 30 );

        JOhm.save( user1 );
    }
}

@Model
class User {
    @Id
    private Long id;
    @Attribute
    private String name;
    @Attribute
    private int age;

    public Long getId()
    {
        return this.id;
    }

    public void setName( String Name )
    {
        this.name = Name;
    }

    public String getName()
    {
        return this.name;
    }

    public void setAge( Integer Age )
    {
        this.age = Age;
    }

    public Integer getAge()
    {
        return this.age;
    }
}
@cpeake
Copy link

cpeake commented Dec 15, 2011

I am also getting this exact error message running the same sample code, has this been investigated any further?

@cpeake
Copy link

cpeake commented Dec 15, 2011

Confirmed that there is a bug in the 0.5.0 build by running the same sample code against the latest JOhm source code compiled locally which works.

@jeserkin
Copy link
Author

I haven't investigated this. Also I see, that author isn't too active on this project.

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

2 participants