Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 339195

Summary: generate-ddl @ElementCollection<@Embeddable> creates Table with wrong datatype (VARCHAR instead of TIMESTAMP)
Product: z_Archived Reporter: Jörg Schömer <joerg-schoemer>
Component: EclipselinkAssignee: Project Inbox <eclipselink.orm-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: eclipselink.orm-inbox, michael.f.obrien, tom.ware
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Jörg Schömer CLA 2011-03-08 06:01:20 EST
Build Identifier: 2.2.0

The Model below should create two tables like:

CREATE TABLE A_TAB (ID NUMBER(19), NAME VARCHAR(255))
CREATE TABLE A_EVENTS (A_ID NUMBER(19), WHO VARCHAR(255), WHEN TIMESTAMP)

but EclipseLink generates the these:

CREATE TABLE A_TAB (ID NUMBER(19), NAME VARCHAR(255))
CREATE TABLE A_EVENTS (A_ID NUMBER(19), WHO VARCHAR(255), WHEN VARCHAR(255))

Model:

@Entity
@Table(name="A_TAB")
@SequenceGenerator(name = "A_SEQ", sequenceName = "A_SEQ")
class A {

  @Id
  @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "A_SEQ")
  Integer id;

  String name;

  @ElementCollection
  @CollectionTable(name="A_EVENTS", joinColumns={"A_ID", referencedColumnName = "ID"})
  List<Event> events;

}

@Embeddable
class Event {

  String who;

  @Temporal(TemporalType.TIMESTAMP)
  Date when;

}


Reproducible: Always

Steps to Reproduce:
see details.
Comment 1 Tom Ware CLA 2011-03-18 09:41:58 EDT
Setting target and priority.  See the following page for the meanings of these fields:

http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines

Community: Please vote for this bug if it is important to you.  Votes are one of the main criteria we use to determine which bugs to fix next.
Comment 2 Eclipse Webmaster CLA 2022-06-09 10:02:27 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink