QBE « Query « JPA Q&A





1. How to secure Hibernate QBE query    stackoverflow.com

By the moment, I know four kinds of doing transactions with hibernate:

  1. Using objects
  2. Using HQL
  3. Using DB-specific SQL
  4. Using criteria (QBE)
Well, regarding how strong are they against injections, I think these are (correct me ...

2. Help required on hibernate QBE    coderanch.com

Hi, I have a Set of DetailsObject in MasterObject. MasterObject maps to a "Master" table and DetailsObject maps to a "Details" table which have Master.ID as foreign key. Now I want to query whether MasterObject exist in database or not. But it should compare all the DetailsObject from the Set also in the detail table. I tried like this... List list ...

3. Hibernate HQL and QBE questions    coderanch.com

I have two tables: Student and Class. They have a many-to-many relationship through a join table (Student_Class). I'm using Oracle 10g. The table structures are listed below using SQLPLUS: SQL>desc Student IDNumber STUDENT_NAMEVarchar2(50) SQL>desc Class IDNumber CLASS_NAMEVarchar2(50) SQL> desc Student_Class IDNumber STUDENT_IDNubmer CLASS_IDNumber The IDs are the PKs and the Student_ID and Class_ID are the FKs. I can find the classes ...

4. QBE on Class-Hierarchy    forum.hibernate.org

Newbie Joined: Wed Oct 13, 2010 9:07 am Posts: 1 Hi! i have this type oh hierarchy: Imbarcazione is father, and ImbarcazioneGommone, ImbarcazionePanfilo and ImbarcazioneVela are her sons. I must create an QBE to find an object but the query doesn't return me an object. This is the code of query Code: public List ricercaImbarcazione(String cf, String cn, String n) ...

5. QBE with primitive types    forum.hibernate.org

Hi All, I've scoured the forums & FAQs and I believe I know the answer to this, but I haven't seen it stated explicitly. I'm trying to use Query by Example on entities that have primitive type properties. Since these can't be null, it seems the Hibernate engine adds those to the SQL as part of the where clause, even though ...

6. QBE problem    forum.hibernate.org

Hibernate version: Hibernate 2.1.6 Mapping documents: Adres ***************************************************** ...

7. QBE uniqueResult()    forum.hibernate.org

I have a little question! I'am trying to do a query by example on a primary key. I know that of you put it in a List he is ignoring the primary key. But i now just want one result. Artikel result; Example exampleObject = Example.create(artikel).excludeZeroes(); Criteria criteria = session.createCriteria(Artikel.class); result = (Artikel) criteria.add(exampleObject).uniqueResult(); return result; if i search for another ...

8. Performing QBE on Views    forum.hibernate.org

Hello, Relatively new to Hibernate, I am trying to perform a query by example on Views. However, none of the restrictions I place are converted to SQL, resulting in a WHERE (1=1) irreguardless of how many parameters I set in my example object. I have heard that Hibernate ignores ID's while performing QBE. Is there any possibility that Hibernate is seeing ...

9. QBE concat    forum.hibernate.org





10. QBE Problem    forum.hibernate.org

Hi, I have a QBE query where I have an Offence Entity, that has a foreign key Entity called 'FleetVehicle'. The associations are setup correctly I believe. The Offence POJO Entity contains a FleetVehicle POJO/Entity but when I reference fleetVehicle.registrationNumber (I expect the QBE to do the join for me...) it bails complaining that it cannot resolve the field registrationNumber in ...

11. QBE and QBC returning bogus results    forum.hibernate.org

Beginner Joined: Mon Dec 06, 2004 4:20 pm Posts: 34 Hi, I have a simplified version of te auction database from the "Hibernate In Action" book, with a 1-many relationship between item and bid. I have 6 items in my item table, 5 with the description of "old guitar" and one with the description of "Strat". When I do a query ...

12. Can I create a disjunction across collections using QBE?    forum.hibernate.org

I'm putting together a demo for my coworkers to show them why we should move our mixed EJB 1.1/EJB 2.1 app to hibernate during our JBoss conversion. Part of this demo will be a QBE demo. I have three simple classes: Person String firstName String lastName Set addresses (relates to Address) Email email (relates to Email ) Address String line1, line2 ...

13. Can I make QBE ignore empty strings?    forum.hibernate.org

Hibernate version:2.18 Struts 1.1 It appears that the using the struts tag will treat null values as empty strings. So, if a user does not enter a value for a given field, instead of this field being null, it gets set to "". So, when I try to do something like this ... First Name: First Name:

14. Question with QBE construct    forum.hibernate.org

Newbie Joined: Tue Apr 05, 2005 3:52 pm Posts: 2 Location: Minneapolis, MN Hi, I'm new to hibernate so please bear with me. My question is not exception/bug related but rather feature/functionality related. Specifically, I want to leverage the power of the QBE capabilities inherent within Hibernate...and yet not return the full collections of objects, but rather only a simple collection ...

15. Using QBE w/Collections Properties    forum.hibernate.org

Newbie Joined: Wed Jul 13, 2005 12:24 am Posts: 2 Is it possible to use Query by Example (QBE) with Object properties that are Collections? I have a User object that has a field that is a collection. I need to create a typical dynamic query where a 'search' collection is passed in and the query needs to return all users ...

16. automatic inclusion of associations with QBE    forum.hibernate.org

I'm using the QBE interface, and see that it doesn't include associations. I also see that I can include them semi-manually using the Criteria interface. That all works well. What I want now is some code that would walk a graph of example objects and automatically add associations to the root Criteria. I think I could write that, but before I ...





18. QBE compisition classes ignored.    forum.hibernate.org

19. QBE not working    forum.hibernate.org

Newbie Joined: Sat Mar 18, 2006 3:34 pm Posts: 2 Need help with Hibernate? Read this first: http://www.hibernate.org/ForumMailingli ... AskForHelp Hibernate version: 3.0 Mapping documents: Code:

20. QBE "or" where clause instead of "and"    forum.hibernate.org

Is it possible with QBE to generate an "or" where clause instead of "and" Heres an example of what I mean. POJO User { firstname = "joe" lastname="hibernate" } Example ex = Example.create( u ).ignoreCase().enableLike( MatchMode.ANYWHERE ); getSession().createCriteria( User.class ) .add( ex ); generates sql like: select .... from user where firstname='joe' AND lastname='hibernate' is possible to get it to do ...

21. Writing QBE that handles associations - how do I detect?    forum.hibernate.org

OK - I answered my own question here. In order to make QBE recognize associations, you can use: Property.Type.isAssociationType() For example: Code: public List findByExample(T exampleInstance) { return findByCriteria(exampleInstance,Example.create(exampleInstance).enableLike(MatchMode.EXACT)); } protected List findByCriteria(T exampleInstance,Criterion... criterion) { ...

22. QBE and QBC    forum.hibernate.org

I want to retrieve Account instances from AccountDTO instance: This works: Code: Example example = Example.create(account) .ignoreCase() .excludeZeroes() ...

23. Sorting Results Using QBE    forum.hibernate.org

Hibernate version:3.2 I'm using the Query By Example (QBE) technique to get a list of Facilities. I want to sort the results by Facility name. Everything works accept the the "ignoreCase()" has no effect. Am I doing something wrong? Code: public static List findFacility(Session hSession, Facility facility, int firstResult, int maxResults) throws HibernateException { ...

24. QBE not working    forum.hibernate.org

I'm trying to use query by example combining two classes, just like the second example given in page 682 of "Java Persistence with Hibernate". I have a class Route that has a List of Waypoint, called waypointList. I want to find all routes that has a waypoint with name "WP2": Code: Waypoint wp = new ...