Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] @BasicCollection non storing Integer type

Looks like a bug. Please enter one.

In the mean time as a work around, try setting a TypeConverter on your mapping. That is,

@BasicCollection(valueColumn = @Column(name = "ALARM"))
@CollectionTable(name = "SETTINGS_ALARMS", primaryKeyJoinColumns ={@PrimaryKeyJoinColumn(name = "SETTINGS_ID", referencedColumnName = "ID")})
@Convert(Integer2Integer)
@TypeConverter(
   name="Integer2Integer",
   dataType=Integer.class,
   objectType=Integer.class
)

Cheers,
Guy

----- Original Message ----- From: "astarte" <g.turek@xxxxxxxxxxxxx>
To: <eclipselink-users@xxxxxxxxxxx>
Sent: Tuesday, September 30, 2008 10:35 PM
Subject: [eclipselink-users] @BasicCollection non storing Integer type




My code:

@BasicCollection(valueColumn = @Column(name = "ALARM"))
@CollectionTable(name = "SETTINGS_ALARMS", primaryKeyJoinColumns =
{@PrimaryKeyJoinColumn(name = "SETTINGS_ID", referencedColumnName = "ID")})
 private Set<Integer> alarms = new HashSet<Integer>();

 public Set<Integer> getAlarms()
 {
   return Collections.unmodifiableSet(alarms);
 }
 public void addAlarm(int alarm)
 {
   alarms.add(alarm);
 }

However the values of alarms are stored as strings. Has anyone experienced
this?
Thank you
gaby
--
View this message in context: http://www.nabble.com/%40BasicCollection-non-storing-Integer-type-tp19753488p19753488.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.

_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users




Back to the top