Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 358521 - Cannot parse @OneToMany annotation correctly
Summary: Cannot parse @OneToMany annotation correctly
Status: CLOSED INVALID
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Paul Harmon CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-22 03:14 EDT by Zhi Zhu CLA
Modified: 2017-02-23 14:16 EST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zhi Zhu CLA 2011-09-22 03:14:45 EDT
1 Record Customer definition
   record Customer/Order type Entity
	cust_id int {@Id};
	name string;

	// Mark this as an Association to the OrderHeader Entity
	orders Order[] {@OneToMany{mappedby=OrderHeader.cust_id}} ;
   end

   record OrderHeader type Entity{@table{name = "Orders"}}
	// Primary key
	order_id int {@Id};
	// Foreign key to owning Customer {@JoinColumn {name="cust_id"}};
	cust_id int{@ManyToOne};
	price float;
	
	// Association to owning Customer Entity {@ManyToOne}
	//customer Customer;
   end


  the line:
     orders Order[] {@OneToMany{mappedby=OrderHeader.cust_id}} ;
  has compilation error indicating cust_id is not recognized.


 When get TypeBinding for the annotation, cannot get its field, in this case the  value for 'mappedby'
Comment 1 Zhi Zhu CLA 2011-09-22 03:45:43 EDT
Paul, in the definition for Customer and OrderHeader, if I define the below two variables:
   aCust Customer;
   anOrder OrderHeader;

  and have the following statement:
     get aCust.orders from ds;

  Now I can the data binding for orders which belonging to customers, but cannot get data binding for customer, only can get type binding for Customer, is it possible for me to get data binding for aCust in this case? thanks
Comment 2 Joseph Vincens CLA 2011-09-22 17:06:50 EDT
Tim had said not all functionality would be in 0.7.0, but that list was never
defined. I have updated 355573 to include a list of what is supported for 0.7.0
and what is future. @ManyToMany, @ManyToOne, @OneToMany, @OneToOne,
@SecondaryTables are future.
Comment 3 Zhi Zhu CLA 2011-09-22 20:26:54 EDT
Joe, thanks very much for clarification, as those annotations you listed here are for entity association, so we only support basic SQL generation(only one table), more complex scenario will be supported in future
Comment 4 Zhi Zhu CLA 2011-10-11 20:38:45 EDT
close it