Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01EQNA6DJ9VgCtW6zhCE8Xud
36 lines
602 B
Java
Executable File
36 lines
602 B
Java
Executable File
package com.ankurm.hibernatedemo.naturalid;
|
|
|
|
import jakarta.persistence.Entity;
|
|
import jakarta.persistence.GeneratedValue;
|
|
import jakarta.persistence.Id;
|
|
|
|
/**
|
|
* Parent side of the composite natural id demo -- see {@link Department}.
|
|
*
|
|
* <p>Docs: docs/06-natural-ids.md, Topic 3.
|
|
*/
|
|
@Entity
|
|
public class Company {
|
|
|
|
@Id
|
|
@GeneratedValue
|
|
private Long id;
|
|
|
|
private String name;
|
|
|
|
public Company() {
|
|
}
|
|
|
|
public Company(String name) {
|
|
this.name = name;
|
|
}
|
|
|
|
public Long getId() {
|
|
return id;
|
|
}
|
|
|
|
public String getName() {
|
|
return name;
|
|
}
|
|
}
|