JPA 2 in Jboss and criteria api
Is there a working JPA 2 implementation for JBoss server? Or maybe there is some additional extension that provides JPA 2's criteria api equivalent? ...
Is there a working JPA 2 implementation for JBoss server? Or maybe there is some additional extension that provides JPA 2's criteria api equivalent? ...
I need to give to a Criteria a list of string receive another one, the sql that makes this is: select loginName from SimpleUsers where loginName in ('admin', 'oscar', 'stig') but I need it in NHinbernate criteria, can anyone please help me with this ? ...
Hi all, I have an entity with a set say like Libray--->books Now I want to retrieve the libraries where ALL the books have a genre So I have something like this c.createCriteria("library", "library").createCriteria("books", "book"); c.add(Restrictions.isNotNull("book.genre")); If I execute the query I get the libraries where at least ...
Stumped on this one. I have a many to many self referencing relationship(FluentNH) mapped for a given class: public class Folder { public IList<Folder> ParentFolders{get;set;} } I'm looking to create a query that pulls root folders(ie folders that have ParentFolders.Count() == 0). The self reference is done via lookup table, so Pa...
I'm trying to create a Criteria query to select objects that are related via an association table. Insurer * - 1 Insurer_Section 1 - * Section InsurerSection has an association attribute: active:bool. How do I get all Insurers whose active attribute in the InsurerSection class is set to true? PS: I can't go like this: Insurer.FindA...
In my domain model I have following Classes.A 'UserProfile' has one 'SecurityPrincipal' class SecurityPrincipal{ private String loginId; private String password; private Date registeredData; private int status; } class UserProfile { private String name; private String company; private SecurityPrincipa principal } I want to ge...
my create query (HQL) looks like: Session.CreateQuery( "select a from Article as a join a.Categories c where c.ID = :ID") .SetInt32("ID", categoryId) ...
I have an object that has many assocations to other objects. All of these are fetched lazily by nHibernate, which is good in almost all cases. In a particular scenario, in this case an export of a lot of records, I want to set the Fetchmode to eager on all associations. Is there a way to do this, without having to manually specify each...
I have a varchar field in a table, mapped to string property on a class. Pretty simple stuff, however when I create a criteria to retieve enities based on this field, NHibernare is generating invalid sql. The where clause looks like "Where accountnum = 120001", which won't work with a varchar obviously. Any ideas? ...
I can't for the life of me find a good NH ICriteria walkthrough. Can anyone assist in pointing one out? ...
I have a class AppUser; class AppUser { private String firstName; private String lastName; //-- getters and setters } I also have another class Student; class Student { private AppUser appUser; private Date dateOfBirth; //-- getters and setters } How would i search for Student John Doe, firstName John, lastName Do...
can you delete using criteria query? I want to do: DELETE bookmars WHERE userID = @userID How can I do this with criteria? ...
I need to do a query which checks a column in a table of type integer. how can i use expression.sql(nHIbernate Criteria API) to get all the rows matches the given number. Thank you, Rey. ...
I have classes that look like this public class Agreement { public virtual string ArrgKey { get; set; } public virtual string SubjectCode { get; set; } // mapped as a HasMany to AgreementStateCountyRelation public virtual IList<AgreementStateCountyRelation> StateCounties { get; set; } } public class AgreementStateCount...
My criteria looks like: Session.CreateCriteria(typeof(User)) .Add(Expression.Eq("IsActive", 1); Do I put 1 or True for the IsActive boolean check? (non seem to work?) what are my options? ...
My problem seems pretty straightforward to me, but I just can't seem to find an answer that works. I have a Hibernate Entity which has a ManyToMany association with another Entity, which is fetched lazily by default. I want to create a Criteria which will return the Entity with the ManyToMany association loaded eagerly. Here is the Enti...
Is it possible to limit the number of associated entities fetched through a Hibernate Criteria? Consider the following two entities: @Entity public class History { @OneToMany private List<Entry> entries ... } @Entity public class Entry { @ManyToOne private History history; private DateTime date; ... } I need to us...
I need to be able to find all items in a table where the id of each item is not in a relational mapping table. In other words, I have one table where each row has an id. If that id is in a map table, it should not show up in my list. I was thinking of querying my map table for all id's in it, then turning around and querying my main t...
I have a Criteria-Query, which joins a second table B, to select entities from table A. The problem is, that this query returns some entities from table A multiple times. But I need the results to be distinct. Using Criteria.DISTINCT_ROOT_ENTITY is useless, becaus this filters out the multiple occurences after the SQL-Query was execute...
I've been looking at an open source clone of SO, http://github.com/cnprog/CNPROG I don't know Python/Django but I can still read whats going on, The developers, seem to only be awarding badges with cron jobs, The awards are given out by the methods, being the "Rules" of the Criteria that must be met to achieve the award. in this file...