package io.reflectoring.coderadar.core.projectadministration.domain;

import javax.persistence.*;
import lombok.Data;

/** a user of application, who has to login to access to functionality */
@Entity
@Table(
  name = "user_account",
  uniqueConstraints = {@UniqueConstraint(columnNames = "username")}
)
@SequenceGenerator(name = "user_sequence", sequenceName = "seq_user_id", allocationSize = 1)
@Data
public class User {

  @Id
  @Column(name = "id")
  @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "user_sequence")
  private Long id;

  @Column(name = "username", nullable = false)
  private String username;

  @Column(name = "password", nullable = false)
  private String password;
}

package io.reflectoring.coderadar.core.projectadministration.domain;

import javax.persistence.*;
import lombok.Data;
import org.neo4j.ogm.annotation.NodeEntity;

/** a user of application, who has to login to access to functionality */
@NodeEntity
@Data
public class User {
  private Long id;
  private String username;
  private String password;
}

Convert the entity User to Neo4j