Hello all.
I try to use enum fields in entity-class
...
@Entity
public class NotificationAddress extends VersionObject {
public enum NotificationType { EMAIL, SMS, SMB };
private NotificationType notificationType;
...
Then i try to filter objects by this type:
...
em.createQuery("select o from NotificationAddress o where o.notificationType = " + NotificationType.EMAIL).getSingleResult();
...
or
...
em.createQuery("select o from NotificationAddress o where o.notificationType = " + NotificationType.EMAIL.ordinal()).getSingleResult();
...
I receive error:
Exception [TOPLINK-115] (Oracle TopLink Essentials - 2006.8 (Build 060908)): oracle.toplink.essentials.exceptions.DescriptorException Exception Description: No conversion value provided for the attribute [1]. Mapping: oracle.toplink.essentials.mappings.DirectToFieldMapping[notificationType-->NOTIFICATIONADDRESS.NOTIFICATIONTYPE] Descriptor: RelationalDescriptor(ejb.entity.NotificationAddress --> [DatabaseTable(VERSIONOBJECT), DatabaseTable(NOTIFICATIONADDRESS)])
How to use enum types?