Bug 325528 - No way to call a method entityManager.merge(x);
Summary: No way to call a method entityManager.merge(x);
Status: CLOSED INVALID
Alias: None
Product: AspectJ
Classification: Tools
Component: IDE (show other bugs)
Version: 1.6.10   Edit
Hardware: PC Windows Vista
: P3 blocker (vote)
Target Milestone: ---   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-16 16:35 EDT by Ed Pichler CLA
Modified: 2010-09-30 12:42 EDT (History)
1 user (show)

See Also:


Attachments
Prints (85.84 KB, application/octet-stream)
2010-09-16 16:36 EDT, Ed Pichler CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Pichler CLA 2010-09-16 16:35:18 EDT
I'm tryng to do this Aspect


...
// merge
	public void Address.merge1() {
		//JPA Entity Manager
		EntityManager ent = getEntityManager();
		
		Address a = ent.merge(this);
		
		ent.flush();
		this.id = merged.getId();
	}

....


But the errors are showed at the prints. I've tried in two ways.
Comment 1 Ed Pichler CLA 2010-09-16 16:36:02 EDT
Created attachment 179071 [details]
Prints

Attaching screenshots.
Comment 2 PASTUREL CLA 2010-09-30 11:30:09 EDT
Is your Aspect inherits from Address ?
Is your Aspect a persistent Entity ( in JPA terms) ?
Is so, you have certainly to cast with an Address class.

the prototype of method merge is :
 <T> T merge(T entity)
so "this" must be persistent ...
Comment 3 Ed Pichler CLA 2010-09-30 12:42:42 EDT
Yes, I checked this items. 
You can close this bug. I need to send more details next time. I don't remember what I did that day.