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

timestamp type can not be assigned #19

Closed
ggaaooppeenngg opened this issue Aug 9, 2014 · 3 comments
Closed

timestamp type can not be assigned #19

ggaaooppeenngg opened this issue Aug 9, 2014 · 3 comments

Comments

@ggaaooppeenngg
Copy link

java.sql.SQLException: Could not assign object 'Thu Aug 07 11:09:25 EDT 2014' to field FieldType:name=created_time,class=Homework

I got this warming when I query "Homeworks"

and I define my created_time as

public class Homework {
    @DatabaseField(generatedId = true)
    private Integer id;
    @DatabaseField
    private String URI;
    @DatabaseField
    private Integer assignment_id;
    @DatabaseField(dataType = DataType.TIME_STAMP, format = "yyyy-MM-dd HH:mm:ss")
    private Timestamp created_time;
    @DatabaseField
    private String title;
}

I searched for stackoverflow and tried some solutions but did work it out.

@ggaaooppeenngg
Copy link
Author

I change to util.Date, it then works.

@j256
Copy link
Owner

j256 commented Feb 16, 2015

I've added the type in the error message that would have helped with this. In your code, any chance you were using something other than a java.sql.Timestamp?

@j256
Copy link
Owner

j256 commented Jun 8, 2016

I'm going to close for now.

@j256 j256 closed this as completed Jun 8, 2016
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