Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java

Ayush Bahuguna
Ayush Bahuguna
95 Points

`id` can't be initialized with `null`

Hi,

I don't think that you can instantiate id with null in your BaseEntity. And that's why my app won't run. I don't think we have to initialize it to anything, as long as our database can autogenerate a value.

I am using PostgreSQL, so I have set my id column type as bigserial, so it would auto generate a sequence.

Otherwise, the application throws Cannot instantiate test object error.