openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Youwanes <mark_youwa...@yahoo.com>
Subject Re: ClassCast exception while iterating over an element collection of embeddables
Date Sat, 21 Jul 2012 02:05:38 GMT
Hi Rick,

I'm using OpenJPA 2.2.0 and build-time enhancement. The ftp connection is 
getting retrieved eagerly as a member of a ClientRegion object:

@Entity
@Table(name = "client_region")
public class ClientRegion extends AbstractNamedEntity {
    
    private static final long serialVersionUID = 1L;
    
    public static final String FIND_ALL_BY_CLIENT_NAME_QUERY = 
"ClientRegion.findAllByClientName";
    public static final String CLIENT_NAME_QUERY_PARAM = "clientName";
    public static final String STATUS_QUERY_PARAM = "status";
    
    @Enumerated(EnumType.STRING)
    @Column(name = "STATUS")
    private Status status = ACTIVE;
    
    @ManyToOne
    @JoinColumn(name = "fk_client_id")
    private Client client;
    
    @Column(name = "brand")
    private String brand;
    
    @ManyToMany(cascade = {
            CascadeType.MERGE, CascadeType.PERSIST
    }, fetch = FetchType.EAGER)
    @JoinTable(name = "core_client_ftp_connection", joinColumns = 
@JoinColumn(name = "fk_client_region_id"), inverseJoinColumns = 
@JoinColumn(name = "fk_ftp_connection_id"))
    private Collection<FtpConnection> ftpConnections = 
new ArrayList<FtpConnection>();

....

I'm using Spring Data JPA to access the objects.

I appreciate your help on this.



Mark





Mime
View raw message