import javax.persistence.Entity;
      import javax.persistence.GenerationType;
      import javax.persistence.Table;
      @Table(name = &[USER_INPUT:name], schema = &[USER_INPUT:schema)
      public class filename {
          @javax.persistence.Column(name = "version")
          int version;
          @javax.persistence.Column(name = "id")
          @javax.persistence.GeneratedValue(strategy = GenerationType.IDENTITY)
          private long id;
          public int getVersion() {
              return version;
          public long getId() {
              return id;
      Java language logo

      Create Hibernate entity

      Create a Hibernate entity with an auto-generated id field and a version field for concurrent modifications

      Shortcut: entity


        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.