[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [eclipselink-users] @BasicCollection non storing Integer type
|
Thank you! Using column definition worked. is this a bug then? If it is I'll
report it
gaby
James Sutherland wrote:
>
> I assume you mean the default table creation is creating a VARCHAR column,
> instead of NUMBER?
>
> You can configure this by setting the columnDefinition of the @Column,
> although it seems like it should work from the code.
>
> Or are you trying to store it as a VARCHAR in the database and Integer is
> Java? If so then you can use a Converter.
>
>
>
> astarte wrote:
>>
>>
>> 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-tp19753488p19767897.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.