Persistence Exception when using pojo bindings in a gaming platform controller

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?

+5
source share
3 answers

I might be a little late for a few months, but I ran into a similar problem and was able to fix it. To get the context right, here was my environment:

  • I initialized the model instance in Bootstrap Job.
  • I was in DEV mode, so I used the database in memory ( db=mem)

(.create(), .save(), .merge()) - . .

, /tmp .

+2

, client.create(); client.save();?

0

, . ( - : user.email), .merge() .save()

merge() save(), ( ). - .

, client.merge()

0

All Articles