Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b4VQVEJWetTT1dYzyJ
16 lines
538 B
Java
16 lines
538 B
Java
package com.ankurm.r2dbc;
|
|
|
|
import org.springframework.data.annotation.Id;
|
|
import org.springframework.data.relational.core.mapping.Table;
|
|
|
|
/**
|
|
* A plain row. Note what is NOT here: no {@code List<PurchaseOrder>} field, no
|
|
* @OneToMany. Spring Data R2DBC maps one row to one object and nothing else.
|
|
*/
|
|
@Table("customer")
|
|
public record Customer(@Id Long id, String name, String email, String tier) {
|
|
public static Customer ofNew(String name, String email, String tier) {
|
|
return new Customer(null, name, email, tier);
|
|
}
|
|
}
|