Ebean.update () is not executed in the inherited model.

environment: playframework 2.5 ebean 7.6.1 Event: Update () is not executed for the inherited model.

The reason is that the setter set it to the inherited value. It will be executed if you set this. ~ Instead of super. ~. According to the specifications, the parent class had a field and was set at the inheritance destination. I think the destination where the setter is actually called and the value is set is the same. Why?

Member.java


@Entity
@Table(name = "member")
public class MemberDatas extends AbstractMemberDatas {
  public void setId(Long Id) {
    super.Id = Id;
  }
  
  public void setMemberId(Long memberId) {
    super.memberId = memberId;
  }

  public Long getId() {
    return Id;
  }

  public Long getMemberId() {
    return memberId;
  }
}

AbstractMember.java


@MappedSuperclass
public abstract class AbstractSentenceDictDatas extends Model {

  @Column(name = "id")
  protected Long Id;

  @Column(name = "memberId")
  protected Long memberId;
}

MemberService.java


~
Member member = new Member();
member.setId(1);
member.setMemberId(1);
member.update();
~

Recommended Posts

Ebean.update () is not executed in the inherited model.
When the project is not displayed in eclipse
[Error] The app is not displayed in the production environment
Until the code is executed
What is the representation of domain knowledge in the [DDD] model?
Error in production environment (The asset "~" is not present in the asset pipeline.)
Behavior when each is executed in the reverse order Range
Data is not registered in Rails.
[Rails] Annotate is not executed when migrating
Spring Autowired is written in the constructor
What to do if the prefix c is not bound in JSP
catch (Exception e) or catch (IOException e) is not required in the try-with-resources syntax
"" Application.js "is not present in the asset pipeline" error in Ruby on Rails
must not return in the for statement
[Rails] About the error that the image is not displayed in the production environment
What is the model test code testing
What is the main method in Java?
Ignore parameters that do not exist in the model with ObjectMapper # readValue
Image is not displayed in production environment
[Cloud9] Yay! You ’re on Rails! Is not displayed in the rails tutorial
How to set when "The constructor Empty () is not visible" occurs in junit
The list of installed apps is not displayed in getPackageManager (Android11 ​​/ API level 30)
What is Pullback doing in The Composable Architecture
Common part css is not applied in thymeleaf
ActiveSupport underscore is not the inverse of camelize
What is the Java Servlet / JSP MVC model?
The intersection type introduced in Java 10 is amazing (?)
The devise error message is not displayed properly.
The MVC model at my workplace is terrible
GoogleMap is not displayed until the browser is reloaded
The public key for jenkins-2.249.1-1.1.noarch.rpm is not installed
[Java] Something is displayed as "-0.0" in the output
[Rails] Bootstrap's text-light cannot be inherited by the link_to method because the class is not written as an argument in the method.
Processing when an ID that does not exist in the database is entered in the URL
Asynchronous processing executed in Future in Swift Combine is sinking, but it is canceled in the middle
In Time.strptime,% j (total date of the year) is
Rails must be exist error (@save is not executed)
Which is better, Kotlin or Java in the future?
PATH does not pass ... The cause is the character code
When Spring Batch is executed continuously in Oracle, ORA-08177
Why the get method is needed in the Calendar class
The story that .java is also built in Unity 2018
Fixed the phenomenon that vuetify built in Rails is not loaded when page transition is done
When I run docker-compose exec in crontab, I get "the input device is not a TTY"
How to solve the problem when the value is not sent when the form is disabled in rails and sent
When rewriting the CMD of docker image of Pod in the manifest of k8s, command is not good
Even if I write the setting of STRICT_QUOTE_ESCAPING in CATALINA_OPTS in tomcat8.5, it is not reflected.