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

Bug 325528

Summary: No way to call a method entityManager.merge(x);
Product: [Tools] AspectJ Reporter: Ed Pichler <duduzerah>
Component: IDEAssignee: aspectj inbox <aspectj-inbox>
Status: CLOSED INVALID QA Contact:
Severity: blocker    
Priority: P3 CC: jeanlouis.pasturel
Version: 1.6.10   
Target Milestone: ---   
Hardware: PC   
OS: Windows Vista   
Whiteboard:
Attachments:
Description Flags
Prints none

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.