Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] mySQL/Oracle behavior differences

Hi all,

We have a map<String,String> attribute which is mapped with ElementCollection mapping inside an embedded object. It is eagerly fetched and it uses BatchFetch.JOIN .

In Mysql deployment, there is no problem persisting/retrieving this attribute. However, in Oracle deployment we are having problem on retrieving the values of the attribute which is mapped with ElementCollection. If there is more than one record retrieved from the main entity, all the elemenCollection mapped attributes are empty even though we have values for them in the database.  

If the query is returning one specific entity ( where id=<value>, then we can get the record with populated ElementCollection mapped attributes. But, if I retrieve all the entities in the table, I don't see anything set to the ElementCollection mapped attributes. They are all empty. 

Is there anybody experience the same issue, or any behavior differences between MySql and Oracle deployment in eclipseLink? We are using EclipseLink 2.1.2 with Weblogic 10.4.

Thanks 
Aysun


Here is how our Entity looks like

@Entity
public class AlarmEntity {
  @Id
  @Column(name="ID")
  private long id;
  ...
  @Embedded  
  private CommonAlarm commonAlarm;
  ...
}

@Embeddable
Public class CommonAlarm implements Serializable {
...

@Embedded
Private AdditionalAttr addAttr = new AdditionalAttr();
.
.
}

@Embeddable
Public class AdditionalAttr extends BaseAttr implements Serializable {

@ElementCollection(fetch=FetchType.EAGER)
@BatchFetch(BatchFetchType.JOIN)
@CollectionTable(name="ADDITIONAL_ATTR", joinColumns = @JoinColumn(name= "ALARM_ID"))
@MapKeyColumn( name = "ATTRNAME")
@Column(name= "VALUE")
private final Map<String String> anvp = new HashMap<String String>
.
.
}



Back to the top