package org.minimalj.example.minimalclinic.model;

import java.time.LocalDate;

import org.minimalj.model.Keys;
import org.minimalj.model.Rendering;
import org.minimalj.model.annotation.NotEmpty;
import org.minimalj.model.annotation.Size;
import org.minimalj.util.DateUtils;

public class Pet implements Rendering {
	public static final Pet $ = Keys.of(Pet.class);
			
	public Object id;
	
	public Owner owner;
	
	@NotEmpty @Size(30)
	public String name;
	
	@NotEmpty
    public LocalDate birthDate;

	@NotEmpty
	public PetType type;
    
//    public List<Visit> getVisits() {
//    	if (Keys.isKeyObject(this)) return Keys.methodOf(this, "visits", List.class);
//    	return Backend.read(Visit.class, By.field(Visit.$.pet, this), 100);
//    }
        
    @Override
    public String render(RenderType renderType) {
    	return name + ", " + DateUtils.format(birthDate) + ", " + type.render(renderType);
    }

}

@@ -536,224 +536,8 @@
    %0A
-//    public List%3CVisit%3E getVisits() %7B%0A//    %09if (Keys.isKeyObject(this)) return Keys.methodOf(this, %22visits%22, List.class);%0A//    %09return Backend.read(Visit.class, By.field(Visit.$.pet, this), 100);%0A//    %7D%0A        %0A
     

Remove dead comment