View | Details | Raw Unified | Return to bug 236109
Collapse All | Expand All

(-)src/org/eclipse/jpt/core/context/orm/EntityMappings.java (-3 / +1 lines)
Lines 103-117 Link Here
103
	OrmNamedQuery addNamedQuery(int index);
103
	OrmNamedQuery addNamedQuery(int index);
104
	void removeNamedQuery(int index);
104
	void removeNamedQuery(int index);
105
	void moveNamedQuery(int targetIndex, int sourceIndex);
105
	void moveNamedQuery(int targetIndex, int sourceIndex);
106
		String NAMED_QUERIES_LIST = "namedQueriesList";
107
106
108
		@SuppressWarnings("unchecked")
107
	@SuppressWarnings("unchecked")
109
	ListIterator<OrmNamedNativeQuery> namedNativeQueries();
108
	ListIterator<OrmNamedNativeQuery> namedNativeQueries();
110
	int namedNativeQueriesSize();
109
	int namedNativeQueriesSize();
111
	OrmNamedNativeQuery addNamedNativeQuery(int index);
110
	OrmNamedNativeQuery addNamedNativeQuery(int index);
112
	void removeNamedNativeQuery(int index);
111
	void removeNamedNativeQuery(int index);
113
	void moveNamedNativeQuery(int targetIndex, int sourceIndex);
112
	void moveNamedNativeQuery(int targetIndex, int sourceIndex);
114
		String NAMED_NATIVE_QUERIES_LIST = "namedNativeQueriesList";
115
113
116
		
114
		
117
	
115
	
(-)src/org/eclipse/jpt/core/internal/context/orm/GenericEntityMappings.java (-10 / +11 lines)
Lines 23-28 Link Here
23
import org.eclipse.jpt.core.context.NamedNativeQuery;
23
import org.eclipse.jpt.core.context.NamedNativeQuery;
24
import org.eclipse.jpt.core.context.NamedQuery;
24
import org.eclipse.jpt.core.context.NamedQuery;
25
import org.eclipse.jpt.core.context.Query;
25
import org.eclipse.jpt.core.context.Query;
26
import org.eclipse.jpt.core.context.QueryHolder;
26
import org.eclipse.jpt.core.context.orm.EntityMappings;
27
import org.eclipse.jpt.core.context.orm.EntityMappings;
27
import org.eclipse.jpt.core.context.orm.OrmGenerator;
28
import org.eclipse.jpt.core.context.orm.OrmGenerator;
28
import org.eclipse.jpt.core.context.orm.OrmNamedNativeQuery;
29
import org.eclipse.jpt.core.context.orm.OrmNamedNativeQuery;
Lines 401-412 Link Here
401
		OrmNamedQuery namedQuery = getJpaFactory().buildOrmNamedQuery(this);
402
		OrmNamedQuery namedQuery = getJpaFactory().buildOrmNamedQuery(this);
402
		this.namedQueries.add(index, namedQuery);
403
		this.namedQueries.add(index, namedQuery);
403
		this.xmlEntityMappings.getNamedQueries().add(index, OrmFactory.eINSTANCE.createXmlNamedQuery());
404
		this.xmlEntityMappings.getNamedQueries().add(index, OrmFactory.eINSTANCE.createXmlNamedQuery());
404
		this.fireItemAdded(EntityMappings.NAMED_QUERIES_LIST, index, namedQuery);
405
		this.fireItemAdded(QueryHolder.NAMED_QUERIES_LIST, index, namedQuery);
405
		return namedQuery;
406
		return namedQuery;
406
	}
407
	}
407
	
408
	
408
	protected void addNamedQuery(int index, OrmNamedQuery namedQuery) {
409
	protected void addNamedQuery(int index, OrmNamedQuery namedQuery) {
409
		addItemToList(index, namedQuery, this.namedQueries, EntityMappings.NAMED_QUERIES_LIST);
410
		addItemToList(index, namedQuery, this.namedQueries, QueryHolder.NAMED_QUERIES_LIST);
410
	}
411
	}
411
	
412
	
412
	public void removeNamedQuery(NamedQuery namedQuery) {
413
	public void removeNamedQuery(NamedQuery namedQuery) {
Lines 416-431 Link Here
416
	public void removeNamedQuery(int index) {
417
	public void removeNamedQuery(int index) {
417
		OrmNamedQuery namedQuery = this.namedQueries.remove(index);
418
		OrmNamedQuery namedQuery = this.namedQueries.remove(index);
418
		this.xmlEntityMappings.getNamedQueries().remove(index);
419
		this.xmlEntityMappings.getNamedQueries().remove(index);
419
		fireItemRemoved(EntityMappings.NAMED_QUERIES_LIST, index, namedQuery);
420
		fireItemRemoved(QueryHolder.NAMED_QUERIES_LIST, index, namedQuery);
420
	}
421
	}
421
422
422
	protected void removeNamedQuery_(OrmNamedQuery namedQuery) {
423
	protected void removeNamedQuery_(OrmNamedQuery namedQuery) {
423
		removeItemFromList(namedQuery, this.namedQueries, EntityMappings.NAMED_QUERIES_LIST);
424
		removeItemFromList(namedQuery, this.namedQueries, QueryHolder.NAMED_QUERIES_LIST);
424
	}
425
	}
425
	
426
	
426
	public void moveNamedQuery(int targetIndex, int sourceIndex) {
427
	public void moveNamedQuery(int targetIndex, int sourceIndex) {
427
		this.xmlEntityMappings.getNamedQueries().move(targetIndex, sourceIndex);
428
		this.xmlEntityMappings.getNamedQueries().move(targetIndex, sourceIndex);
428
		moveItemInList(targetIndex, sourceIndex, this.namedQueries, EntityMappings.NAMED_QUERIES_LIST);		
429
		moveItemInList(targetIndex, sourceIndex, this.namedQueries, QueryHolder.NAMED_QUERIES_LIST);		
429
	}
430
	}
430
	
431
	
431
	public ListIterator<OrmNamedNativeQuery> namedNativeQueries() {
432
	public ListIterator<OrmNamedNativeQuery> namedNativeQueries() {
Lines 440-451 Link Here
440
		OrmNamedNativeQuery namedNativeQuery = getJpaFactory().buildOrmNamedNativeQuery(this);
441
		OrmNamedNativeQuery namedNativeQuery = getJpaFactory().buildOrmNamedNativeQuery(this);
441
		this.namedNativeQueries.add(index, namedNativeQuery);
442
		this.namedNativeQueries.add(index, namedNativeQuery);
442
		this.xmlEntityMappings.getNamedNativeQueries().add(index, OrmFactory.eINSTANCE.createXmlNamedNativeQuery());
443
		this.xmlEntityMappings.getNamedNativeQueries().add(index, OrmFactory.eINSTANCE.createXmlNamedNativeQuery());
443
		this.fireItemAdded(EntityMappings.NAMED_QUERIES_LIST, index, namedNativeQuery);
444
		this.fireItemAdded(QueryHolder.NAMED_NATIVE_QUERIES_LIST, index, namedNativeQuery);
444
		return namedNativeQuery;
445
		return namedNativeQuery;
445
	}
446
	}
446
	
447
	
447
	protected void addNamedNativeQuery(int index, OrmNamedNativeQuery namedNativeQuery) {
448
	protected void addNamedNativeQuery(int index, OrmNamedNativeQuery namedNativeQuery) {
448
		addItemToList(index, namedNativeQuery, this.namedNativeQueries, EntityMappings.NAMED_NATIVE_QUERIES_LIST);
449
		addItemToList(index, namedNativeQuery, this.namedNativeQueries, QueryHolder.NAMED_NATIVE_QUERIES_LIST);
449
	}
450
	}
450
	
451
	
451
	public void removeNamedNativeQuery(NamedNativeQuery namedNativeQuery) {
452
	public void removeNamedNativeQuery(NamedNativeQuery namedNativeQuery) {
Lines 455-470 Link Here
455
	public void removeNamedNativeQuery(int index) {
456
	public void removeNamedNativeQuery(int index) {
456
		OrmNamedNativeQuery namedNativeQuery = this.namedNativeQueries.remove(index);
457
		OrmNamedNativeQuery namedNativeQuery = this.namedNativeQueries.remove(index);
457
		this.xmlEntityMappings.getNamedNativeQueries().remove(index);
458
		this.xmlEntityMappings.getNamedNativeQueries().remove(index);
458
		fireItemRemoved(NAMED_NATIVE_QUERIES_LIST, index, namedNativeQuery);
459
		fireItemRemoved(QueryHolder.NAMED_NATIVE_QUERIES_LIST, index, namedNativeQuery);
459
	}
460
	}
460
461
461
	protected void removeNamedNativeQuery_(OrmNamedNativeQuery namedNativeQuery) {
462
	protected void removeNamedNativeQuery_(OrmNamedNativeQuery namedNativeQuery) {
462
		removeItemFromList(namedNativeQuery, this.namedNativeQueries, EntityMappings.NAMED_NATIVE_QUERIES_LIST);
463
		removeItemFromList(namedNativeQuery, this.namedNativeQueries, QueryHolder.NAMED_NATIVE_QUERIES_LIST);
463
	}
464
	}
464
	
465
	
465
	public void moveNamedNativeQuery(int targetIndex, int sourceIndex) {
466
	public void moveNamedNativeQuery(int targetIndex, int sourceIndex) {
466
		this.xmlEntityMappings.getNamedNativeQueries().move(targetIndex, sourceIndex);
467
		this.xmlEntityMappings.getNamedNativeQueries().move(targetIndex, sourceIndex);
467
		moveItemInList(targetIndex, sourceIndex, this.namedNativeQueries, EntityMappings.NAMED_NATIVE_QUERIES_LIST);		
468
		moveItemInList(targetIndex, sourceIndex, this.namedNativeQueries, QueryHolder.NAMED_NATIVE_QUERIES_LIST);		
468
	}
469
	}
469
470
470
	//TODO what about qualified name?  package + class
471
	//TODO what about qualified name?  package + class

Return to bug 236109