<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4254687216482090110</id><updated>2012-02-15T22:59:07.266-08:00</updated><category term='webservice'/><category term='ejb ql'/><category term='List size'/><category term='XQuery'/><category term='java'/><category term='XPath'/><category term='onetomany'/><category term='jpa'/><category term='Command Pattern'/><category term='JAXB'/><category term='web service'/><category term='size'/><category term='s9api'/><category term='jee'/><category term='j2ee'/><category term='JWS'/><category term='Query'/><category term='Visitor Pattern'/><category term='axis'/><category term='axis2'/><category term='Saxon'/><title type='text'>Java Learnings</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://skhjava.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4254687216482090110/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://skhjava.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Sandeep Khurana</name><uri>https://profiles.google.com/106554556189118731110</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-GUfU1hBBq0k/AAAAAAAAAAI/AAAAAAAAALI/oM1JNa7gHqA/s512-c/photo.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>14</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4254687216482090110.post-8493562469756942881</id><published>2011-01-30T19:32:00.001-08:00</published><updated>2011-01-30T19:32:15.533-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Command Pattern'/><title type='text'>Command Pattern</title><content type='html'>Why this pattern has name as 'Command' ? Because someone gives a command and not care how..who will do it...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4254687216482090110-8493562469756942881?l=skhjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skhjava.blogspot.com/feeds/8493562469756942881/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4254687216482090110&amp;postID=8493562469756942881' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4254687216482090110/posts/default/8493562469756942881'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4254687216482090110/posts/default/8493562469756942881'/><link rel='alternate' type='text/html' href='http://skhjava.blogspot.com/2011/01/command-pattern.html' title='Command Pattern'/><author><name>Sandeep Khurana</name><uri>https://profiles.google.com/106554556189118731110</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-GUfU1hBBq0k/AAAAAAAAAAI/AAAAAAAAALI/oM1JNa7gHqA/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4254687216482090110.post-8900807174687743689</id><published>2011-01-28T22:48:00.000-08:00</published><updated>2011-01-28T22:48:24.522-08:00</updated><title type='text'>How To Become A Hacker</title><content type='html'>&lt;a href="http://catb.org/esr/faqs/hacker-howto.html"&gt;How To Become A Hacker&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4254687216482090110-8900807174687743689?l=skhjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://catb.org/esr/faqs/hacker-howto.html' title='How To Become A Hacker'/><link rel='replies' type='application/atom+xml' href='http://skhjava.blogspot.com/feeds/8900807174687743689/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4254687216482090110&amp;postID=8900807174687743689' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4254687216482090110/posts/default/8900807174687743689'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4254687216482090110/posts/default/8900807174687743689'/><link rel='alternate' type='text/html' href='http://skhjava.blogspot.com/2011/01/how-to-become-hacker_28.html' title='How To Become A Hacker'/><author><name>Sandeep Khurana</name><uri>https://profiles.google.com/106554556189118731110</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-GUfU1hBBq0k/AAAAAAAAAAI/AAAAAAAAALI/oM1JNa7gHqA/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4254687216482090110.post-6107419341763091027</id><published>2011-01-28T22:47:00.000-08:00</published><updated>2011-01-28T22:47:45.690-08:00</updated><title type='text'>How To Become A Hacker</title><content type='html'>&lt;a href="http://catb.org/esr/faqs/hacker-howto.html"&gt;How To Become A Hacker&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4254687216482090110-6107419341763091027?l=skhjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://catb.org/esr/faqs/hacker-howto.html' title='How To Become A Hacker'/><link rel='replies' type='application/atom+xml' href='http://skhjava.blogspot.com/feeds/6107419341763091027/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4254687216482090110&amp;postID=6107419341763091027' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4254687216482090110/posts/default/6107419341763091027'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4254687216482090110/posts/default/6107419341763091027'/><link rel='alternate' type='text/html' href='http://skhjava.blogspot.com/2011/01/how-to-become-hacker.html' title='How To Become A Hacker'/><author><name>Sandeep Khurana</name><uri>https://profiles.google.com/106554556189118731110</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-GUfU1hBBq0k/AAAAAAAAAAI/AAAAAAAAALI/oM1JNa7gHqA/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4254687216482090110.post-6531462258637791224</id><published>2011-01-27T14:43:00.000-08:00</published><updated>2011-01-27T14:43:26.911-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visitor Pattern'/><title type='text'>Visitor Pattern</title><content type='html'>Why - As per wikipedia it is "is a way of separating an algorithm from an object structure it operates on". &lt;br /&gt;&lt;br /&gt;Lets discuss with an example &lt;br /&gt;&lt;br /&gt; - object structure - e.g. getters and setters of a class with attributes interest, principle. &lt;br /&gt;  (i.e. getInterest(), getPrinciple()). Lets say the class name having these getters and setters is 'Amount'. &lt;br /&gt;&lt;br /&gt; - algorithm to calculate the interest in a class InterestCalculator. While getting the interest from 'Amount', InterestCalculator.calculate needs to be called. &lt;br /&gt;&lt;br /&gt;- Amount is Visitable  (Visitable is interface which has 'getInterest' method)&lt;br /&gt;&lt;br /&gt;  class Amount implements Visitable  { &lt;br /&gt;   &lt;br /&gt;      getInterest(Visitor visitor) { &lt;br /&gt;        visitor.visit(this) ;&lt;br /&gt;      } &lt;br /&gt;&lt;br /&gt;  } &lt;br /&gt; &lt;br /&gt;- InterestCalculator is 'Visitor'  (Visitor is an interface which have visit method) &lt;br /&gt;    &lt;br /&gt;   class InterestCalculator implements Visitor { &lt;br /&gt;&lt;br /&gt;      visit(Amount amount)  { &lt;br /&gt;         // calculation goes here &lt;&lt;&lt;&lt;&lt;&lt;&lt;------------&lt;br /&gt;      }&lt;br /&gt;   } &lt;br /&gt;&lt;br /&gt;- The client (e.g. main method) has to know which visitor (i.e. intetestcalculator) to inject into the accept method. &lt;br /&gt;&lt;br /&gt;   It invokes it like &lt;br /&gt;     Amount a = new Amount() ;&lt;br /&gt;    // set values in 'a' object e.g. Principal&lt;br /&gt;    a.getInterest(new InterestCalculator)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4254687216482090110-6531462258637791224?l=skhjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skhjava.blogspot.com/feeds/6531462258637791224/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4254687216482090110&amp;postID=6531462258637791224' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4254687216482090110/posts/default/6531462258637791224'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4254687216482090110/posts/default/6531462258637791224'/><link rel='alternate' type='text/html' href='http://skhjava.blogspot.com/2011/01/visitor-pattern.html' title='Visitor Pattern'/><author><name>Sandeep Khurana</name><uri>https://profiles.google.com/106554556189118731110</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-GUfU1hBBq0k/AAAAAAAAAAI/AAAAAAAAALI/oM1JNa7gHqA/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4254687216482090110.post-4403617357214042615</id><published>2010-10-10T03:36:00.001-07:00</published><updated>2010-10-10T03:36:55.875-07:00</updated><title type='text'></title><content type='html'>helios emf&lt;br /&gt;&lt;br /&gt;&lt;a 14243756"="" frameborder="0" height="280" href="http://www.blogger.com/%3Ciframe%20src=" http:="" player.vimeo.com="" video="" width="400"&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://vimeo.com/14243756"&gt;Helios In Action: Modeling&lt;/a&gt; from &lt;a href="http://vimeo.com/eclipselive"&gt;Lynn Gayowski&lt;/a&gt; on &lt;a href="http://vimeo.com/"&gt;Vimeo&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4254687216482090110-4403617357214042615?l=skhjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skhjava.blogspot.com/feeds/4403617357214042615/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4254687216482090110&amp;postID=4403617357214042615' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4254687216482090110/posts/default/4403617357214042615'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4254687216482090110/posts/default/4403617357214042615'/><link rel='alternate' type='text/html' href='http://skhjava.blogspot.com/2010/10/helios-emf-helios-in-action-modeling.html' title=''/><author><name>Sandeep Khurana</name><uri>https://profiles.google.com/106554556189118731110</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-GUfU1hBBq0k/AAAAAAAAAAI/AAAAAAAAALI/oM1JNa7gHqA/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4254687216482090110.post-1670670736209403353</id><published>2009-03-02T03:38:00.000-08:00</published><updated>2009-03-02T03:45:20.447-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='XPath'/><category scheme='http://www.blogger.com/atom/ns#' term='s9api'/><category scheme='http://www.blogger.com/atom/ns#' term='Saxon'/><category scheme='http://www.blogger.com/atom/ns#' term='XQuery'/><title type='text'>XQuery</title><content type='html'>Sometimes when u have a big XML document, you want to iterate through some elements of it.  One way of doing it is to parse it and process the needed elements. Another way might be to use XQuery/XPath. You can directly access the needed elements/attributes and their values using XQuery. &lt;div&gt;I present an example which uses Saxon s9api. Include saxon and saxon's s9api jar in the classpath. Consider this xml string  -&gt; &lt;/div&gt;&lt;div&gt;"&lt;books&gt; &lt;book year="'1999"&gt; &lt;author&gt;Abiteboul&lt;/author&gt; &lt;/book&gt; &lt;/books&gt;"&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Suppose if we want to know the years of the book (imagine there are 100s of 1000s books in the xml, though this xml shows just 1 book). We can use the follwing java code.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt; Processor processor = new Processor(false);&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt; ItemTypeFactory itf = new ItemTypeFactory(processor);&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt; ItemType integerType = itf.getAtomicType(new &lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;QName("http://www.w3.org/2001/XMLSchema", "integer"));&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt; DocumentBuilder builder = processor.newDocumentBuilder();&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;         builder.setLineNumbering(true);&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;         builder.setWhitespaceStrippingPolicy(WhitespaceStrippingPolicy.ALL);&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;         String str = "&lt;books&gt; &lt;book year="'1999"&gt; &lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;&lt;author&gt;Abiteboul&lt;/author&gt; &lt;/book&gt; &lt;/books&gt;";&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;         StringValue strVal = new StringValue(str.subSequence(0, str.length()));&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;         InputStream bais = new ByteArrayInputStream(str.getBytes());&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;         StreamSource ss = new StreamSource(bais);&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt; XdmNode fileNode = builder.build(ss);&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt; XPathCompiler xpc = processor.newXPathCompiler();&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt; XPathExecutable xqe = xpc.compile("/BOOKS/BOOK/@YEAR");&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt; XPathSelector selector = xqe.load();&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt; selector.setContextItem(fileNode);&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt; XdmValue val = selector.evaluate();&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt; XdmSequenceIterator itr = val.iterator();&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt; while(itr.hasNext()) {&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt; XdmItem xi = itr.next();&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt; XdmNode xn = (XdmNode) xi;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt; System.out.println(" Node Name " + xn.getNodeName().getLocalName());&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt; System.out.println(" Node Value " + xn.getStringValue());&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt; }&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Note - We can read an xml saved in a file too in addition to xml in string variable as in above example.&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4254687216482090110-1670670736209403353?l=skhjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skhjava.blogspot.com/feeds/1670670736209403353/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4254687216482090110&amp;postID=1670670736209403353' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4254687216482090110/posts/default/1670670736209403353'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4254687216482090110/posts/default/1670670736209403353'/><link rel='alternate' type='text/html' href='http://skhjava.blogspot.com/2009/03/xquery.html' title='XQuery'/><author><name>Sandeep Khurana</name><uri>https://profiles.google.com/106554556189118731110</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-GUfU1hBBq0k/AAAAAAAAAAI/AAAAAAAAALI/oM1JNa7gHqA/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4254687216482090110.post-4924113518870261190</id><published>2008-12-06T03:01:00.000-08:00</published><updated>2008-12-06T03:10:58.768-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JWS'/><category scheme='http://www.blogger.com/atom/ns#' term='JAXB'/><title type='text'>JWS</title><content type='html'>New spec of JWS uses JAXB 2.0 for JAVA/XML binding. The binding info can be provided in form of annotations on java classes or in external binding file. If annotations have this info then it will be used during deployment and run time. But if the binding information is in external file then it will be used only during deployment time and not during execution. &lt;div&gt;One good feature of this JWS spec is that if some info is not provided on java classes for exposing them as web service then it will assume defaults. &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4254687216482090110-4924113518870261190?l=skhjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skhjava.blogspot.com/feeds/4924113518870261190/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4254687216482090110&amp;postID=4924113518870261190' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4254687216482090110/posts/default/4924113518870261190'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4254687216482090110/posts/default/4924113518870261190'/><link rel='alternate' type='text/html' href='http://skhjava.blogspot.com/2008/12/jws.html' title='JWS'/><author><name>Sandeep Khurana</name><uri>https://profiles.google.com/106554556189118731110</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-GUfU1hBBq0k/AAAAAAAAAAI/AAAAAAAAALI/oM1JNa7gHqA/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4254687216482090110.post-5227544732681424056</id><published>2008-12-05T05:27:00.000-08:00</published><updated>2008-12-05T05:31:50.132-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='jpa'/><category scheme='http://www.blogger.com/atom/ns#' term='onetomany'/><category scheme='http://www.blogger.com/atom/ns#' term='ejb ql'/><category scheme='http://www.blogger.com/atom/ns#' term='Query'/><title type='text'>JPA One to Many query</title><content type='html'>&lt;div&gt;Assume there is a parent entity and has one to many relationship with a child entity. We want to write a query where in a record of parent entity is comapred against each row of its children, we can IN operator.For example &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;SELECT e.name, d.name from Department d, IN(d.employees) e where e.salary &gt; 100000&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4254687216482090110-5227544732681424056?l=skhjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skhjava.blogspot.com/feeds/5227544732681424056/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4254687216482090110&amp;postID=5227544732681424056' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4254687216482090110/posts/default/5227544732681424056'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4254687216482090110/posts/default/5227544732681424056'/><link rel='alternate' type='text/html' href='http://skhjava.blogspot.com/2008/12/jpa-one-to-many-query.html' title='JPA One to Many query'/><author><name>Sandeep Khurana</name><uri>https://profiles.google.com/106554556189118731110</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-GUfU1hBBq0k/AAAAAAAAAAI/AAAAAAAAALI/oM1JNa7gHqA/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4254687216482090110.post-8049874716359823142</id><published>2008-12-03T08:18:00.000-08:00</published><updated>2008-12-03T08:21:03.159-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='jpa'/><category scheme='http://www.blogger.com/atom/ns#' term='List size'/><category scheme='http://www.blogger.com/atom/ns#' term='size'/><title type='text'>Size in JPA</title><content type='html'>JPA has a very nice feature wherein we can get the size of rows in a child table.  The EJB QL will be something like this&lt;div&gt;Select r from Department d where size(d.employees)  &gt; 100&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt; &lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4254687216482090110-8049874716359823142?l=skhjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skhjava.blogspot.com/feeds/8049874716359823142/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4254687216482090110&amp;postID=8049874716359823142' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4254687216482090110/posts/default/8049874716359823142'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4254687216482090110/posts/default/8049874716359823142'/><link rel='alternate' type='text/html' href='http://skhjava.blogspot.com/2008/12/size-in-jpa.html' title='Size in JPA'/><author><name>Sandeep Khurana</name><uri>https://profiles.google.com/106554556189118731110</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-GUfU1hBBq0k/AAAAAAAAAAI/AAAAAAAAALI/oM1JNa7gHqA/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4254687216482090110.post-9112001301709616154</id><published>2008-05-21T22:35:00.000-07:00</published><updated>2008-05-21T22:38:14.193-07:00</updated><title type='text'>Developer..</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_gMMRZxpmlE8/SDUGZJzNECI/AAAAAAAAABg/oRiPAjzr1QY/s1600-h/developers.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://1.bp.blogspot.com/_gMMRZxpmlE8/SDUGZJzNECI/AAAAAAAAABg/oRiPAjzr1QY/s320/developers.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5203071973693657122" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Copied from http://zuru.sufx.net/dev/developers.jpg&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4254687216482090110-9112001301709616154?l=skhjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skhjava.blogspot.com/feeds/9112001301709616154/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4254687216482090110&amp;postID=9112001301709616154' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4254687216482090110/posts/default/9112001301709616154'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4254687216482090110/posts/default/9112001301709616154'/><link rel='alternate' type='text/html' href='http://skhjava.blogspot.com/2008/05/developer.html' title='Developer..'/><author><name>Sandeep Khurana</name><uri>https://profiles.google.com/106554556189118731110</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-GUfU1hBBq0k/AAAAAAAAAAI/AAAAAAAAALI/oM1JNa7gHqA/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_gMMRZxpmlE8/SDUGZJzNECI/AAAAAAAAABg/oRiPAjzr1QY/s72-c/developers.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4254687216482090110.post-7464348038681925251</id><published>2008-05-21T22:25:00.000-07:00</published><updated>2008-05-21T22:29:45.292-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='jee'/><category scheme='http://www.blogger.com/atom/ns#' term='j2ee'/><title type='text'>Choosing a technology for enterprise level application development</title><content type='html'>At the start of the many projects, the teams and business people face the problem of selecting the best technology for the project. There are various factors which need to be considered while selecting any technology. I had been part of many such teams. &lt;br /&gt;Couple of teams decided to go for technology which I would never recommend . &lt;br /&gt;&lt;br /&gt;In one such case, Oracle form was selected to develop the project. The only reason it was selected because it provides quickest way to develop UI. But that not the way to develop an enterprise level project. One has to see the maintenance cost, durability, support for the tech from the vendor, longevity of the project etc. &lt;br /&gt;&lt;br /&gt;In another project HTML DB was selected.  Everything works fine and application goes into production. But the nightmares start when customers start asking for changes, enhancements etc. Since in such tech. the code (mainly SQL and procedural code) is scattered all over the places the changes become headaches. One example is that the team needed to refactor(or normalize) the tables but this idea has to be dropped as the tables were used at many places in SQLs and SQLs were scattered all over the places. Even after changing the testing would have been almost impossible. &lt;br /&gt;&lt;br /&gt;The solution is to develop  the systems in OO languages and the one which provides total ecosystem (from ui, server code etc till deployment phase) for enterprise development. &lt;br /&gt;&lt;br /&gt;J2EE (now JEE) perfectly fits the bill. Many advantages go in favor of JEE tech stack trace. First, it is based upon open standards. If you feel like improving something in it, you can be part of JCP. There is a huge open source community behind it along with well established vendors like IBM, Oracle, SUN etc. It is not dependent upon the whims of one big corporation which will do anything to kill the competition and then later will force its customer to pay heavy license fees and/or buy upgraded expensive versions. J2EE tech provides many frameworks to make the system stable, robust, easy to change,easy to monitor etc (junit, logging, continuous integration etc, mock objects etc). All this adds up to good ROI and feel good and confident factor for the customer.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4254687216482090110-7464348038681925251?l=skhjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skhjava.blogspot.com/feeds/7464348038681925251/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4254687216482090110&amp;postID=7464348038681925251' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4254687216482090110/posts/default/7464348038681925251'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4254687216482090110/posts/default/7464348038681925251'/><link rel='alternate' type='text/html' href='http://skhjava.blogspot.com/2008/05/choosing-technology-for-enterprise.html' title='Choosing a technology for enterprise level application development'/><author><name>Sandeep Khurana</name><uri>https://profiles.google.com/106554556189118731110</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-GUfU1hBBq0k/AAAAAAAAAAI/AAAAAAAAALI/oM1JNa7gHqA/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4254687216482090110.post-7202440665495347644</id><published>2008-05-09T04:12:00.000-07:00</published><updated>2008-05-11T23:14:30.655-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='axis2'/><category scheme='http://www.blogger.com/atom/ns#' term='webservice'/><category scheme='http://www.blogger.com/atom/ns#' term='web service'/><category scheme='http://www.blogger.com/atom/ns#' term='axis'/><title type='text'>Axis2 - Exposing an existing java service as web service using axis 2</title><content type='html'>1) set axis2 classes in the classpath. Copy jars from axis2-installation-directory/lib folder.&lt;br /&gt; These jars will go in WEB-INF/lib folder&lt;br /&gt;  Can download axis2 from http://ws.apache.org/axis2/ &lt;br /&gt;  &lt;br /&gt;2) Add the following, as shown in the picture in the web.xml of your web project&lt;br /&gt;   &lt;b&gt; Click to enlarge below image &lt;/b&gt; &lt;br /&gt;&lt;br /&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_gMMRZxpmlE8/SCQ8Ya1lWTI/AAAAAAAAAAw/IAXvUc2Un5E/s1600-h/axis2.bmp"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;" src="http://1.bp.blogspot.com/_gMMRZxpmlE8/SCQ8Ya1lWTI/AAAAAAAAAAw/IAXvUc2Un5E/s320/axis2.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5198346260110989618" /&gt;&lt;/a&gt;&lt;br /&gt;    &lt;br /&gt; As per the last mappping if the URL contains /services/ it will be routed to the AxisServlet. Other servlet mappings need not be there, if not required.&lt;br /&gt;    &lt;br /&gt;So the end point address for the Web service will become &lt;br /&gt;http://host:port/webcontext/&lt;b&gt;&lt;u&gt;services&lt;/u&gt;&lt;/b&gt;/webservicename&lt;br /&gt;    &lt;br /&gt;    &lt;br /&gt;3. Create services folder(i.e. with name 'services') in the WEB-INF folder &lt;br /&gt;4. Create new folder inside the services folder with the name same as the web service name e.g. DataService&lt;br /&gt;5. Create META-INF folder inside the  folder created above in step 4 .&lt;br /&gt;  DataService&lt;br /&gt;   --- META-INF&lt;br /&gt;6. Create services.xml inside META-INF folder&lt;br /&gt;  DataService&lt;br /&gt;   --- META-INF&lt;br /&gt;      services.xml&lt;br /&gt;&lt;br /&gt;  Write info about your web services in the services.xml like in the picture. &lt;br /&gt;  &lt;br /&gt;&lt;b&gt; Click to enlarge below image &lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_gMMRZxpmlE8/SCQ8o61lWUI/AAAAAAAAAA4/G-Z3mNyft1o/s1600-h/services.bmp"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;" src="http://3.bp.blogspot.com/_gMMRZxpmlE8/SCQ8o61lWUI/AAAAAAAAAA4/G-Z3mNyft1o/s320/services.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5198346543578831170" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;     &lt;br /&gt;&lt;br /&gt; Thats all...your web service is exposed to the world now.... :-). If you want to create wsdl of the web service and are using eclipse then can download axis2 eclipse plugings from http://ws.apache.org/axis2/tools/1_0/eclipse/wsdl2java-plugin.html&lt;br /&gt; &lt;br /&gt; Caution - Please make sure the cases of the service names match in the service.xml and the folder which is created.&lt;br /&gt; &lt;br /&gt; Next topic - Integration with spring&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4254687216482090110-7202440665495347644?l=skhjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skhjava.blogspot.com/feeds/7202440665495347644/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4254687216482090110&amp;postID=7202440665495347644' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4254687216482090110/posts/default/7202440665495347644'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4254687216482090110/posts/default/7202440665495347644'/><link rel='alternate' type='text/html' href='http://skhjava.blogspot.com/2008/05/axis2-exposing-existing-java-service-as.html' title='Axis2 - Exposing an existing java service as web service using axis 2'/><author><name>Sandeep Khurana</name><uri>https://profiles.google.com/106554556189118731110</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-GUfU1hBBq0k/AAAAAAAAAAI/AAAAAAAAALI/oM1JNa7gHqA/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_gMMRZxpmlE8/SCQ8Ya1lWTI/AAAAAAAAAAw/IAXvUc2Un5E/s72-c/axis2.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4254687216482090110.post-6419087080809753121</id><published>2007-06-26T23:05:00.000-07:00</published><updated>2007-06-26T23:11:34.689-07:00</updated><title type='text'>Spring global session scope</title><content type='html'>For beans used in portlet environment, global session scope can be used, if the bean needs to be in session scope. If scope specified is global session but the bean is used in http servlet environment then by default session scope will be used and no exception will be thrown.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4254687216482090110-6419087080809753121?l=skhjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skhjava.blogspot.com/feeds/6419087080809753121/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4254687216482090110&amp;postID=6419087080809753121' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4254687216482090110/posts/default/6419087080809753121'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4254687216482090110/posts/default/6419087080809753121'/><link rel='alternate' type='text/html' href='http://skhjava.blogspot.com/2007/06/spring-global-session-scope.html' title='Spring global session scope'/><author><name>Sandeep Khurana</name><uri>https://profiles.google.com/106554556189118731110</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-GUfU1hBBq0k/AAAAAAAAAAI/AAAAAAAAALI/oM1JNa7gHqA/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4254687216482090110.post-420326202335050824</id><published>2007-06-22T18:01:00.000-07:00</published><updated>2007-06-22T18:25:44.791-07:00</updated><title type='text'>Spring depends-on</title><content type='html'>In Spring framework, if one bean A does not depend on another bean B. That is A does not has property B. But some static block of B needs to be invoked before A is instantiated. In this case, depends-on attribute can be used for A, wherein A depends-on B.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4254687216482090110-420326202335050824?l=skhjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skhjava.blogspot.com/feeds/420326202335050824/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4254687216482090110&amp;postID=420326202335050824' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4254687216482090110/posts/default/420326202335050824'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4254687216482090110/posts/default/420326202335050824'/><link rel='alternate' type='text/html' href='http://skhjava.blogspot.com/2007/06/spring-depends-on.html' title='Spring depends-on'/><author><name>Sandeep Khurana</name><uri>https://profiles.google.com/106554556189118731110</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-GUfU1hBBq0k/AAAAAAAAAAI/AAAAAAAAALI/oM1JNa7gHqA/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry></feed>
