I have the following entity:
@Entity
public class Client extends Model{
public String email;
public String password;
}
I have the following controller :
public static void clientSignUp(models.Client client)
{
info("Client email" + client.email);
info("Client password" + client.password);
client.create();
}
When this controller is called, the two logs print out correctly. But the client.create line errors with this hibernate exception:
PersistenceException occured : org.hibernate.PropertyAccessException:
could not get a field value by reflection getter of models.Client.email
However, when i change the code slightly to :
public static void clientSignUp(models.Client client)
{
models.Client client2 = new Client();
client2.email= client.email;
client2.password = client.password;
client2.create();
}
It works. Any ideas why?
I may be be a few months late to answer this, but I ran into a similar issue and was able to fix it. To get the context right, here was my environment:
Job
.db=mem
)I tried all of the above options (.create()
, .save()
, .merge()
) - none of it worked for me. Nor did an application re-start.
Finally, what did the trick was clearing the /tmp
directory and a restart of the app.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With