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, two logs print correctly. But client.create string errors with this hibernation exception:
PersistenceException occured : org.hibernate.PropertyAccessException:
could not get a field value by reflection getter of models.Client.email
However, when I slightly change the code 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?
source
share