Menu

Photo stero type in Element Collection infinite loop

Shankar
2015-04-14
2015-04-16
  • Shankar

    Shankar - 2015-04-14

    I have the following entities

    Resident Header

    @Entity
    @Tab(properties="apartment.number,moveInDate,moveOutDate,type")

    public class ResidentHeader {

    @Id
    @Hidden
    @GeneratedValue(strategy=GenerationType.AUTO)
    private int id;
    
    @ReferenceView("A")
    @ManyToOne
    private Apartment apartment;
    
    private Date moveInDate;
    
    private Date moveOutDate;
    
    @Enumerated(EnumType.STRING)
    @Required
    private ResidentType type;
    
    @ElementCollection
    @ListProperties("name, email, mobile,photo")
    
    private Collection<ResidentDetail> details;
    
    public Collection<ResidentDetail> getDetails() {
        return details;
    }
    
    public void setDetails(Collection<ResidentDetail> details) {
        this.details = details;
    }
    
    public int getId() {
        return id;
    }
    
    public void setId(int id) {
        this.id = id;
    }
    
    public Apartment getApartment() {
        return apartment;
    }
    
    public void setApartment(Apartment apartment) {
        this.apartment = apartment;
    }
    
    public Date getMoveInDate() {
        return moveInDate;
    }
    
    public void setMoveInDate(Date moveInDate) {
        this.moveInDate = moveInDate;
    }
    
    public Date getMoveOutDate() {
        return moveOutDate;
    }
    
    public void setMoveOutDate(Date moveOutDate) {
        this.moveOutDate = moveOutDate;
    }
    
    public ResidentType getType() {
        return type;
    }
    
    public void setType(ResidentType type) {
        this.type = type;
    }
    

    }

    @Embeddable
    public class ResidentDetail {

    @Column(length=50)
    @Required
    private String name;
    
    @Column(length=20)
    @Stereotype("EMAIL")
    private String email;
    
    @Column(length=10)
    private String mobile;
    
    @Stereotype("PHOTO")
    private byte[] photo;
    
    public String getName() {
        return name;
    }
    
    public void setName(String name) {
        this.name = name;
    }
    
    public String getEmail() {
        return email;
    }
    
    public void setEmail(String email) {
        this.email = email;
    }
    
    public String getMobile() {
        return mobile;
    }
    
    public void setMobile(String mobile) {
        this.mobile = mobile;
    }
    
    public byte[] getPhoto() {
        return photo;
    }
    
    public void setPhoto(byte[] photo) {
        this.photo = photo;
    }
    

    In the element collection I have a photo field. When I try choose the photo and add it to the collection it gets into a infinite loop. It does not add the photo to the UI after the loadimage button is chosen get into infinite loop

     
  • Shankar

    Shankar - 2015-04-14

    Attached document with UI

     
  • Javier Paniza

    Javier Paniza - 2015-04-16

    Hi Shankar:

    PHOTO stereotype is not supported in element collection. If you think that is interesting adding it, add a Feature Request for that.


    Help others in this forum as I help you.

     

Log in to post a comment.