Hi Maria,

I am facing same kind of issue. Is your issue get fixed ? if yes please 
share sample code.

On Sunday, June 22, 2014 at 1:02:18 AM UTC+5:30, Maria Gomez wrote:
>
> Hi,
>
> In my current project we are using Dropwizard to build a bunch of 
> microservices. We also started using dropwizard-hibernate as the ORM to 
> deal with our Postgress DB. Everything went fine until our model started to 
> grow and we needed to add relationships between the entities. I have a 
> Gist <https://gist.github.com/mariagomez/a0e1011bfb8b0cca0c9d> that show 
> an example of our code.
>
> Basically, we have an Company object that contains a Person object, so in 
> the DB we created a Companies and a People tables and a foreign key to link 
> them. We defined the relationship in the code following the Hibernate 
> documentation and assumed that when the Service (or CompanyDAO) persists 
> the company object it would cascade to persist the Person one too. However, 
> when we run the tests we have this exception:
>
> org.hibernate.engine.jdbc.spi.SqlExceptionHelper: ERROR: null value in 
> column "company_id" violates not-null constraint
>   Detail: Failing row contains (5, test founder, null). 
>
> We have been trying to make this work for the last couple of days but we 
> haven't gone anywhere :(  Do you guys have any idea of what is going on???
>
> Thanks!
> Maria
>

-- 
You received this message because you are subscribed to the Google Groups 
"dropwizard-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to