<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Getting started with the EJB 3.0 Query Language (EJBQL 3.0) using GlassFish reference implementation</title>
	<atom:link href="http://technology.amis.nl/2006/02/22/getting-started-with-the-ejb-30-query-language-ejbql-30-using-glassfish-reference-implementation/feed/" rel="self" type="application/rss+xml" />
	<link>http://technology.amis.nl/2006/02/22/getting-started-with-the-ejb-30-query-language-ejbql-30-using-glassfish-reference-implementation/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=getting-started-with-the-ejb-30-query-language-ejbql-30-using-glassfish-reference-implementation</link>
	<description></description>
	<lastBuildDate>Tue, 11 Jun 2013 22:09:58 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
	<item>
		<title>By: john</title>
		<link>http://technology.amis.nl/2006/02/22/getting-started-with-the-ejb-30-query-language-ejbql-30-using-glassfish-reference-implementation/#comment-2921</link>
		<dc:creator>john</dc:creator>
		<pubDate>Fri, 23 Sep 2011 17:46:23 +0000</pubDate>
		<guid isPermaLink="false">http://technology.amis.nl/blog/?p=1065#comment-2921</guid>
		<description><![CDATA[hi, i have this subquery
@NamedQuery(name = &quot;MmTablaDetalle.InstF&quot;, query = &quot;select o from MmTablaDetalle o where o.tabCve = 6 and o.tabDetVal =1 and o.tabDetCve not in( select b.nSsiTip from SermetServicioInstancia b where b.nSesId = :p_sesid )&quot;)
i dot know what im doing wrong pls help me]]></description>
		<content:encoded><![CDATA[<p>hi, i have this subquery<br />
@NamedQuery(name = &#8220;MmTablaDetalle.InstF&#8221;, query = &#8220;select o from MmTablaDetalle o where o.tabCve = 6 and o.tabDetVal =1 and o.tabDetCve not in( select b.nSsiTip from SermetServicioInstancia b where b.nSesId = :p_sesid )&#8221;)<br />
i dot know what im doing wrong pls help me</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: michaelsmith035</title>
		<link>http://technology.amis.nl/2006/02/22/getting-started-with-the-ejb-30-query-language-ejbql-30-using-glassfish-reference-implementation/#comment-2920</link>
		<dc:creator>michaelsmith035</dc:creator>
		<pubDate>Sat, 30 Jul 2011 04:03:07 +0000</pubDate>
		<guid isPermaLink="false">http://technology.amis.nl/blog/?p=1065#comment-2920</guid>
		<description><![CDATA[The programmer only need to know the properties of objects and use them in the queryh. The programmer does not write database specific SQL query syntax.
&lt;a href=&quot;http://www.techyv.com/questions/need-write-ejb-ql&quot; rel=&quot;nofollow&quot;&gt;http://www.techyv.com/questions/need-write-ejb-ql&lt;/a&gt;]]></description>
		<content:encoded><![CDATA[<p>The programmer only need to know the properties of objects and use them in the queryh. The programmer does not write database specific SQL query syntax.<br />
<a href="http://www.techyv.com/questions/need-write-ejb-ql" rel="nofollow">http://www.techyv.com/questions/need-write-ejb-ql</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Douglas</title>
		<link>http://technology.amis.nl/2006/02/22/getting-started-with-the-ejb-30-query-language-ejbql-30-using-glassfish-reference-implementation/#comment-2919</link>
		<dc:creator>Douglas</dc:creator>
		<pubDate>Mon, 03 Aug 2009 14:02:11 +0000</pubDate>
		<guid isPermaLink="false">http://technology.amis.nl/blog/?p=1065#comment-2919</guid>
		<description><![CDATA[Sorry the query is

SELECT c.* FROM contact c, user_contact uc, user usr
WHERE usr.username = ? AND usr.id = uc.user_id
AND uc.contact_id = c.id]]></description>
		<content:encoded><![CDATA[<p>Sorry the query is</p>
<p>SELECT c.* FROM contact c, user_contact uc, user usr<br />
WHERE usr.username = ? AND usr.id = uc.user_id<br />
AND uc.contact_id = c.id</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Douglas</title>
		<link>http://technology.amis.nl/2006/02/22/getting-started-with-the-ejb-30-query-language-ejbql-30-using-glassfish-reference-implementation/#comment-2918</link>
		<dc:creator>Douglas</dc:creator>
		<pubDate>Mon, 03 Aug 2009 14:01:36 +0000</pubDate>
		<guid isPermaLink="false">http://technology.amis.nl/blog/?p=1065#comment-2918</guid>
		<description><![CDATA[Hi Lucas,
back again for help.

Having a scenario where we have users, contacts and finally a table which relate both.

user_table
id
username
name
surname
email


contact_table
id
name
surname
email

user_contact_table
user_id;
contact_id;

How can I provide @JoinTable or any other annotation which allow to apply a JoinTable over contact_table, user_table and user_contact_table having as condition that a user might have several contacts.

Would you mind giving me an example where JPA would retrieves all contacts of a particulare user.

In native SQL I would provide this solution:

SELECT c.* FROM contact c, user_contact uc, user usr
WHERE usr.username = ? AND usr.id = uc.user_id
AND uc.contact_id = c.id &quot;, Contact.class

The above query in ANSI sql language and it works in most databases

My problem is that I DON&#039;T KNOW how to provide same result by using JPA in EJBQL or simply mapping the relationships.


Please, any example you might provide would be very welcome and huge contribution.


Douglas]]></description>
		<content:encoded><![CDATA[<p>Hi Lucas,<br />
back again for help.</p>
<p>Having a scenario where we have users, contacts and finally a table which relate both.</p>
<p>user_table<br />
id<br />
username<br />
name<br />
surname<br />
email</p>
<p>contact_table<br />
id<br />
name<br />
surname<br />
email</p>
<p>user_contact_table<br />
user_id;<br />
contact_id;</p>
<p>How can I provide @JoinTable or any other annotation which allow to apply a JoinTable over contact_table, user_table and user_contact_table having as condition that a user might have several contacts.</p>
<p>Would you mind giving me an example where JPA would retrieves all contacts of a particulare user.</p>
<p>In native SQL I would provide this solution:</p>
<p>SELECT c.* FROM contact c, user_contact uc, user usr<br />
WHERE usr.username = ? AND usr.id = uc.user_id<br />
AND uc.contact_id = c.id &#8220;, Contact.class</p>
<p>The above query in ANSI sql language and it works in most databases</p>
<p>My problem is that I DON&#8217;T KNOW how to provide same result by using JPA in EJBQL or simply mapping the relationships.</p>
<p>Please, any example you might provide would be very welcome and huge contribution.</p>
<p>Douglas</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lucas Jellema</title>
		<link>http://technology.amis.nl/2006/02/22/getting-started-with-the-ejb-30-query-language-ejbql-30-using-glassfish-reference-implementation/#comment-2917</link>
		<dc:creator>Lucas Jellema</dc:creator>
		<pubDate>Mon, 03 Aug 2009 11:51:02 +0000</pubDate>
		<guid isPermaLink="false">http://technology.amis.nl/blog/?p=1065#comment-2917</guid>
		<description><![CDATA[Hi Douglas,&lt;br /&gt;Thanks for your elaborate comment. Could you please indicate to what extent the article I provided the link to did not answer your specific questions with regard to the ALS_PUBLISHERS_BOOKS table (I realize this article uses ALS_AUTHORSHIPS to link BOOK to AUTHOR but the principle is of course the same.&lt;br /&gt;&lt;br /&gt;
Lucas]]></description>
		<content:encoded><![CDATA[<p>Hi Douglas,<br />Thanks for your elaborate comment. Could you please indicate to what extent the article I provided the link to did not answer your specific questions with regard to the ALS_PUBLISHERS_BOOKS table (I realize this article uses ALS_AUTHORSHIPS to link BOOK to AUTHOR but the principle is of course the same.</p>
<p>Lucas</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Douglas</title>
		<link>http://technology.amis.nl/2006/02/22/getting-started-with-the-ejb-30-query-language-ejbql-30-using-glassfish-reference-implementation/#comment-2916</link>
		<dc:creator>Douglas</dc:creator>
		<pubDate>Mon, 03 Aug 2009 11:14:08 +0000</pubDate>
		<guid isPermaLink="false">http://technology.amis.nl/blog/?p=1065#comment-2916</guid>
		<description><![CDATA[Hi Lucas,
thank you for responding to such important subject.
Well, most of us are seniors develepors or software architects and that&#039;s why we might not agree but if we talk to any database expert designer, we problably would not agree either because developers and architects come from a completely different technological background and filosofy, we have our paradigms and views and database designers have their.

Database designers take care of the quality of design of a relational database as we do when we provide a software solution, on the other hand they do not care about how fast and portable would be the software interfacing their databases, they still need to provide their designing rules and approaches to provide an excellent, consistent, reliable and normalized database tables.

Like us, they care about their goal and their is to bring normalization onto their databases.


Here there are some of the rules of Data Normalization.

http://www.datamodel.org

1.	Eliminate Repeating Groups - Make a separate table for each set of related attributes, and give each table a primary key.

2.	Eliminate Redundant Data - If an attribute depends on only part of a multi-valued key, remove it to a separate table.

3.	Eliminate Columns Not Dependent On Key - If attributes do not contribute to a description of the key, remove them to a separate table.

4.	Boyce-Codd Normal Form - If there are non-trivial dependencies between candidate key attributes, separate them out into distinct tables.

5.	Isolate Independent Multiple Relationships - No table may contain two or more 1:n or n:m relationships that are not directly related.

6.	Isolate Semantically Related Multiple Relationships - There may be practical constrains on information that justify separating logically related many-to-many relationships.

7.	Optimal Normal Form - a model limited to only simple (elemental) facts, as expressed in Object Role Model notation.

8.	Domain-Key Normal Form - a model free from all modification anomalies.



The above rules are more than applausible and because of these rule I found myself forced to asking you help in providing a EJBQL example which meets these criterias.

Let&#039;s put it like this, assuming that they are right how would you provide a EJBQL abstract scheme where PUBLISHERS, BOOKS and AUTHOR are related by additionals tables as follow:


ALS_PUBLISHERS


ALS_BOOKS


Below an additional table ALS_PUBLISHERS_BOOK relates PUBLISHERS AND BOOKS as database normalization would required, with this approach in mind would you help me by providing an EJBQL example????

ALS_PUBLISHERS_BOOKS
PBR_ID
BOOK_ID


This is a very interesting debate Lucas as there is no an EJBQL example or any ORM example such as hibernate, JDO and so on which raise this concern.


Best regards

Douglas]]></description>
		<content:encoded><![CDATA[<p>Hi Lucas,<br />
thank you for responding to such important subject.<br />
Well, most of us are seniors develepors or software architects and that&#8217;s why we might not agree but if we talk to any database expert designer, we problably would not agree either because developers and architects come from a completely different technological background and filosofy, we have our paradigms and views and database designers have their.</p>
<p>Database designers take care of the quality of design of a relational database as we do when we provide a software solution, on the other hand they do not care about how fast and portable would be the software interfacing their databases, they still need to provide their designing rules and approaches to provide an excellent, consistent, reliable and normalized database tables.</p>
<p>Like us, they care about their goal and their is to bring normalization onto their databases.</p>
<p>Here there are some of the rules of Data Normalization.</p>
<p><a href="http://www.datamodel.org" rel="nofollow">http://www.datamodel.org</a></p>
<p>1.	Eliminate Repeating Groups &#8211; Make a separate table for each set of related attributes, and give each table a primary key.</p>
<p>2.	Eliminate Redundant Data &#8211; If an attribute depends on only part of a multi-valued key, remove it to a separate table.</p>
<p>3.	Eliminate Columns Not Dependent On Key &#8211; If attributes do not contribute to a description of the key, remove them to a separate table.</p>
<p>4.	Boyce-Codd Normal Form &#8211; If there are non-trivial dependencies between candidate key attributes, separate them out into distinct tables.</p>
<p>5.	Isolate Independent Multiple Relationships &#8211; No table may contain two or more 1:n or n:m relationships that are not directly related.</p>
<p>6.	Isolate Semantically Related Multiple Relationships &#8211; There may be practical constrains on information that justify separating logically related many-to-many relationships.</p>
<p>7.	Optimal Normal Form &#8211; a model limited to only simple (elemental) facts, as expressed in Object Role Model notation.</p>
<p>8.	Domain-Key Normal Form &#8211; a model free from all modification anomalies.</p>
<p>The above rules are more than applausible and because of these rule I found myself forced to asking you help in providing a EJBQL example which meets these criterias.</p>
<p>Let&#8217;s put it like this, assuming that they are right how would you provide a EJBQL abstract scheme where PUBLISHERS, BOOKS and AUTHOR are related by additionals tables as follow:</p>
<p>ALS_PUBLISHERS</p>
<p>ALS_BOOKS</p>
<p>Below an additional table ALS_PUBLISHERS_BOOK relates PUBLISHERS AND BOOKS as database normalization would required, with this approach in mind would you help me by providing an EJBQL example????</p>
<p>ALS_PUBLISHERS_BOOKS<br />
PBR_ID<br />
BOOK_ID</p>
<p>This is a very interesting debate Lucas as there is no an EJBQL example or any ORM example such as hibernate, JDO and so on which raise this concern.</p>
<p>Best regards</p>
<p>Douglas</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lucas Jellema</title>
		<link>http://technology.amis.nl/2006/02/22/getting-started-with-the-ejb-30-query-language-ejbql-30-using-glassfish-reference-implementation/#comment-2915</link>
		<dc:creator>Lucas Jellema</dc:creator>
		<pubDate>Sat, 01 Aug 2009 05:27:58 +0000</pubDate>
		<guid isPermaLink="false">http://technology.amis.nl/blog/?p=1065#comment-2915</guid>
		<description><![CDATA[Hi Douglas, &lt;br /&gt;Thanks for your comment. I understand your objection/remark as most of the times the examples provided only reflect the simplest, ideal situation. I do not agree by the way that the foreign from Books to Publishers would not be implemented in this way in a real database design: a book typically is published by a single Publisher, so I see not need for a (more complex) intersection table like you describe. &lt;br /&gt;&lt;br /&gt;
Having said that, intersection tables to support many to many relations do occur frequently. And they are dealt with rather easily in JPA, as I have explained some time ago in the article &lt;a href=&quot;http://technology.amis.nl/blog/972/ejb-30-persistence-manytomany-relations-or-the-objectification-of-the-intersection-table&quot; rel=&quot;nofollow&quot;&gt;http://technology.amis.nl/blog/972/ejb-30-persistence-manytomany-relations-or-the-objectification-of-the-intersection-table&lt;/a&gt;. Could you take a look at that article and let me know whether that addresses the questions/concerns you have?&lt;br /&gt;&lt;br /&gt;best regards&lt;br /&gt;Lucas]]></description>
		<content:encoded><![CDATA[<p>Hi Douglas, <br />Thanks for your comment. I understand your objection/remark as most of the times the examples provided only reflect the simplest, ideal situation. I do not agree by the way that the foreign from Books to Publishers would not be implemented in this way in a real database design: a book typically is published by a single Publisher, so I see not need for a (more complex) intersection table like you describe. </p>
<p>Having said that, intersection tables to support many to many relations do occur frequently. And they are dealt with rather easily in JPA, as I have explained some time ago in the article <a href="http://technology.amis.nl/blog/972/ejb-30-persistence-manytomany-relations-or-the-objectification-of-the-intersection-table" rel="nofollow">http://technology.amis.nl/blog/972/ejb-30-persistence-manytomany-relations-or-the-objectification-of-the-intersection-table</a>. Could you take a look at that article and let me know whether that addresses the questions/concerns you have?</p>
<p>best regards<br />Lucas</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Douglas</title>
		<link>http://technology.amis.nl/2006/02/22/getting-started-with-the-ejb-30-query-language-ejbql-30-using-glassfish-reference-implementation/#comment-2914</link>
		<dc:creator>Douglas</dc:creator>
		<pubDate>Fri, 31 Jul 2009 16:56:36 +0000</pubDate>
		<guid isPermaLink="false">http://technology.amis.nl/blog/?p=1065#comment-2914</guid>
		<description><![CDATA[I want to thank you for this example but at the same time I would like to make a remark regarding this example.
Well, most of the EJB 3.0 and JPA examples provided by reliable organization such as you, sun microsystem and many others, often forget that it is not the java software design that should preveal or govern over the database design and I say this because most of the time examples provided do not really reflect the real life database design, leaving the developers with many doubts about how does the JPA really work arround database tables in terms of JOIN.

For example:


In real life a database designer and administrator will never provide the PUBLISHERS PK AS A FOREIGN KEY INTO THE ALS_BOOKS TABLE, instead they would provide a third table to relate both of them.
For instance, they would provide a new table to support database normalisation as follow:


TABLE NAME =  ALS_PUBLISHER_BOOK

FOREIGN KEYS:
BOOK_ID
PUBLISHER_ID


The above foreign keys will relate ALS_BOOKS AND ALS_PUBLISHER. Something similar would happen to Books and Authors.
With this mind, How would you provide an EJB 3.0 QL example when the relationship between the tables will not be into any of the main entities such as BOOKS, PUBLISHER AND AUTHOR but in a different relating table.

Sorry for my poor English.

Looking forward to your response.


Douglas]]></description>
		<content:encoded><![CDATA[<p>I want to thank you for this example but at the same time I would like to make a remark regarding this example.<br />
Well, most of the EJB 3.0 and JPA examples provided by reliable organization such as you, sun microsystem and many others, often forget that it is not the java software design that should preveal or govern over the database design and I say this because most of the time examples provided do not really reflect the real life database design, leaving the developers with many doubts about how does the JPA really work arround database tables in terms of JOIN.</p>
<p>For example:</p>
<p>In real life a database designer and administrator will never provide the PUBLISHERS PK AS A FOREIGN KEY INTO THE ALS_BOOKS TABLE, instead they would provide a third table to relate both of them.<br />
For instance, they would provide a new table to support database normalisation as follow:</p>
<p>TABLE NAME =  ALS_PUBLISHER_BOOK</p>
<p>FOREIGN KEYS:<br />
BOOK_ID<br />
PUBLISHER_ID</p>
<p>The above foreign keys will relate ALS_BOOKS AND ALS_PUBLISHER. Something similar would happen to Books and Authors.<br />
With this mind, How would you provide an EJB 3.0 QL example when the relationship between the tables will not be into any of the main entities such as BOOKS, PUBLISHER AND AUTHOR but in a different relating table.</p>
<p>Sorry for my poor English.</p>
<p>Looking forward to your response.</p>
<p>Douglas</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: PaKo</title>
		<link>http://technology.amis.nl/2006/02/22/getting-started-with-the-ejb-30-query-language-ejbql-30-using-glassfish-reference-implementation/#comment-2913</link>
		<dc:creator>PaKo</dc:creator>
		<pubDate>Sun, 29 Jul 2007 21:35:26 +0000</pubDate>
		<guid isPermaLink="false">http://technology.amis.nl/blog/?p=1065#comment-2913</guid>
		<description><![CDATA[Note: The NativeQuery can use named parameters - prefixed by # instead of : (for EJB QL named params)]]></description>
		<content:encoded><![CDATA[<p>Note: The NativeQuery can use named parameters &#8211; prefixed by # instead of : (for EJB QL named params)</p>
]]></content:encoded>
	</item>
</channel>
</rss>
