Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 357975 - Invalid JPQL error if named-query is in orm.xml
Summary: Invalid JPQL error if named-query is in orm.xml
Status: VERIFIED FIXED
Alias: None
Product: Dali JPA Tools
Classification: WebTools
Component: JPA (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M3   Edit
Assignee: Pascal Filion CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-16 14:26 EDT by Karen Butzke CLA
Modified: 2011-10-18 11:50 EDT (History)
2 users (show)

See Also:


Attachments
Fix the issue related to orm.xml (16.02 KB, patch)
2011-09-27 19:27 EDT, Pascal Filion CLA
no flags Details | Diff
Fix for bug (17.24 KB, patch)
2011-09-28 16:24 EDT, Pascal Filion CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Karen Butzke CLA 2011-09-16 14:26:59 EDT
I get the validation error "The abstract schema type 'Employee' is unknown" given the following orm.xml entity.

<entity class="model.Employee">
	<named-query name="select">
		<query>SELECT x FROM Employee x</query>
	</named-query>
</entity>

If I add the model.Employee class to the persistence.xml, the error disappears. It should not need to be listed in the persistence.xml.
Comment 1 Pascal Filion CLA 2011-09-27 19:27:42 EDT
Created attachment 204129 [details]
Fix the issue related to orm.xml

The external form used by Hermes was not created correctly, there is no need to make a difference between pu and orm.
Comment 2 Pascal Filion CLA 2011-09-28 16:24:42 EDT
Created attachment 204222 [details]
Fix for bug
Comment 3 Neil Hauge CLA 2011-09-30 11:43:06 EDT
The validation/content assist functionality is working nicely in this patch.  The only issue I am seeing (which may be unrelated to the patch) is an exception when backspacing at the following location in the Details view on an Named Query in an ORM XML Entity:

Select o from Owner o JOIN o.pets[cursor]

I get:

java.util.MissingResourceException: Can't find resource for bundle java.util.PropertyResourceBundle, key COLLECTION_VALUED_PATH_EXPRESSION_NOT_RESOLVABLE
    at java.util.ResourceBundle.getObject(ResourceBundle.java:374)
    at java.util.ResourceBundle.getString(ResourceBundle.java:334)
    at org.eclipse.jpt.jpa.ui.internal.jpql.JpaJpqlContentProposalProvider.buildMessage(JpaJpqlContentProposalProvider.java:322)
    at org.eclipse.jpt.jpa.ui.internal.jpql.JpaJpqlContentProposalProvider.validate(JpaJpqlContentProposalProvider.java:584)
    at org.eclipse.jpt.jpa.ui.internal.jpql.JpaJpqlContentProposalProvider.access$10(JpaJpqlContentProposalProvider.java:567)
    at org.eclipse.jpt.jpa.ui.internal.jpql.JpaJpqlContentProposalProvider$6.modifyText(JpaJpqlContentProposalProvider.java:330)
Comment 4 Neil Hauge CLA 2011-09-30 14:17:11 EDT
Regarding the issue encountered in comment #3, I have open a separate bug 359585.  That issue will be addressed separately as it is not related to this patch.
Comment 5 Pascal Filion CLA 2011-09-30 14:23:43 EDT
Checked in the fix into CVS.
Comment 6 Jolene Moffitt CLA 2011-10-18 11:50:26 EDT
Verified in Build I-3.4.0-20111013215153 

Verified the abstract error does not appear when you add the query.  See the link to view test steps for verification.
http://wiki.eclipse.org/Dali_3.1_M3