package io.reflectoring.cache.dao;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import java.io.Serializable;
import java.util.UUID;

@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class Car implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private UUID id;
    private String name;
    private String color;
}

@@ -29,16 +29,158 @@
 e.dao;%0A%0A
+import com.hazelcast.nio.ObjectDataInput;%0Aimport com.hazelcast.nio.ObjectDataOutput;%0Aimport com.hazelcast.nio.serialization.DataSerializable;%0A
 import l
@@ -205,16 +205,16 @@
 ructor;%0A
-
 import l
@@ -441,28 +441,27 @@
 java.io.
-Serializable
+IOException
 ;%0Aimport
@@ -568,16 +568,20 @@
 lements 
+Data
 Serializ
@@ -694,16 +694,16 @@
 g name;%0A
-
     priv
@@ -719,11 +719,385 @@
 g color;
+%0A%0A    @Override%0A    public void writeData(ObjectDataOutput out) throws IOException %7B%0A        out.writeUTF(id.toString());%0A        out.writeUTF(name);%0A        out.writeUTF(color);%0A    %7D%0A%0A    @Override%0A    public void readData(ObjectDataInput in) throws IOException %7B%0A        id = UUID.fromString(in.readUTF());%0A        name = in.readUTF();%0A        color = in.readUTF();%0A    %7D
 %0A%7D%0A

implement DataSerializable for the Car