filter « Filter « JPA Q&A





1. Can you use custom objects in a Hibernate filter?    stackoverflow.com

I have a hibernate filter that needs to evaluate using two different columns in the database. I have another existing hibernate object that contains both of those fields, and I ...

2. Can this be done using a Hibernate Filter?    stackoverflow.com

In my application I have Documents and Comments. A Comment belongs to exactly one Document, a Document can have several Comments. I have a fairly complicated named query on my Documents:

<query name="public.documents">
 ...

3. Web application request filter    stackoverflow.com

I am using Turbine 2.3.2 with Hibernate 3. My problem is that the Hibernate session is not active when my (Velocity 1.6.4) template is executed, and I am accessing data from ...

4. Coldfusion ORM and Hibernate Filters    stackoverflow.com

I ask you because I'm searching a useful solution to filtering automatically my entity collections. Almost every one of my models have a property true/false called 'active' that authorizes or not an ...

5. Hibernate : Filter Required    bytes.com

CatchSandeepVaid Consider this scenatio : I have one-to-one relation between Product and ProductBasic BUT at database level i have one-to-many between PRODUCT and PRODUCTBASIC tables as history is mainted in the ...

6. Hibernate filter    coderanch.com

7. Help using filters with Hibernate    coderanch.com

8. Hibernate Filter not working    coderanch.com

Hi, I am using below code and the filter is not working Java code:: Configuration cfg = new Configuration(); cfg = cfg.configure(); ...

9. Hibernate: Filtering related issue .    forum.hibernate.org

we are using a collection level filtering to fetch only those collection of entities (CodeValues) whose particular property called 'cdfMeaning' matches a specidfied value, while fetching their parent CodeSet entity. @Entity @Table(name = "CODE_SET") @FilterDef(name="filterCodeValue", parameters = @ParamDef(name = "cdfMeaning", type = "string")) public class CodeSet implements Serializable { private static final long serialVersionUID = -6782112102089236956L; private static final int CODE_SET_NAME ...





10. [SOLVED] Wrong resultSize when using a filter    forum.hibernate.org

EDIT: sorry guys, forgot to enable my filter somewhere. Problem solved :) If you have any question about filters let me know, mine is working now. Hello, So, I'm using a filter in one of my entity to not return outdated events in the result of my search. Here is filter: Code: public class OutdatedEventsFilterFactory { @Factory ...

11. @Filter is not working    forum.hibernate.org

@Name("rubriekDao") public List getAlleRubrieken(String rol) { Session session=(Session) entityManager.getDelegate(); session.enableFilter("f_lijststatus_lijstid").setParameter("lijstid", new Long(65)); List results = entityManager.createQuery("from Rubriek where actief = 1 and (rol is null or instr(rol,:rol) > 0) order by rang").setParameter("rol",rol).getResultList(); session.disableFilter("f_lijststatus_lijstid"); return results; }

12. Hibernate Filters    forum.hibernate.org

13. Passing Multiple Values into Filters    forum.hibernate.org

I have a form with a subform on it. Also contained on the form are 5 comboboxes that are listing the entries in each table. What i would like to be able to do it select an entry in any of the comboboxes and that will in turn filter the subform on the selections made whilst also filtering the remainder comboboxes ...

14. Master/detail: filtering details, get master (noob)    forum.hibernate.org

select ud.* from table1 ud where exists ( select * from table2 co --detail table where co.COD_UB = ud.COD_UB and co.COD_CO = ud.COD_CO and co.IDN_DB_DO = ud.IDN_DB_DO and co.cod_co = 'ASWYX' ) ...

15. Declaring filters on common interface    forum.hibernate.org

Hi Lads, I'd like to ask you whether is possible to declare hibernate filters on common interface? Code: @FilterDef(name = IHasLifeCycle.FILTER_STATUS, parameters = @ParamDef(name = IHasLifeCycle.FILTER_STATUS_PARAM_STATUS, type = "int")) @Filter(name = IHasLifeCycle.FILTER_STATUS, condition = "status=:" + IHasLifeCycle.FILTER_STATUS_PARAM_STATUS) public interface IHasLifeCycle { ...





17. Using filter    forum.hibernate.org

I want to use a servlet for application start up say,StartupListener which extends HttpServlet to initialise the session factory and an ActionFilter to get the session from thread local and pass it to the action class. I specify the following in my web.xml file. I find that if I specify the action filter in web.xml as shown the init method in ...

18. How to use "filter()" to get the size of a lazy co    forum.hibernate.org

Hi, The hibernate docs mention that I can use the "filter()" method to compute the size of a lazy loaded collection without initializing the collection. According to the docs, this line of code will do this: ( (Integer) s.filter( collection, "select count(*)" ).get(0) ).intValue() This, however, does not compile because Session.filter() returns a Collection which does not have a "get()" method. ...

19. Anyone try out the new filter functionality yet?    forum.hibernate.org

I've got the business requirement to implement a dual layer of filtering for certain classes of objects. We're currently using 2.1.x but hibernate 3 looks like it might already be doing what I eventually want to accomplish. One layer is some date constraining and the other is whether or not the data in question belongs to a specific business entity by ...

20. flyweight upcasting filter    forum.hibernate.org

Hibernate version:All versions I've been working a lot with some fat objects recently and it has really got me thinking about a really cool feature that hibernate could do with ... A flyweight upcasting filter. Ok an example .... IdAndTitleInterface { Integer id; String title; } MyFatClass implements IdAndTitleInterface { Integer id; String title; 100 other methods and variables. } IdAndTitleInterface ...

21. How to filter a "elements" return ?    forum.hibernate.org

Hibernate version: 2.1 Mapping documents: Mapping file for table "Equipement"

22. Filters in Hibernate 3 alpha    forum.hibernate.org

Hi all I'm trying testing filters from 3a version. I think it's very useful piece, but most likely row: at me it is impossible to filter successors, neither on fields of a base class, nor on own. If who can prompt, I shall be very grateful. A code and mapping can be send PS: in JIRA on Hibernate 3 alpha such ...

23. Inconsistent behavior between and createFilte    forum.hibernate.org

I'm attempting to create a filter which needs to do a JOIN in order to access the field that I want to filter on. I was able to do this successfully using code like the following. List

sl = s.createFilter(c2.getSections(), "SELECT DISTINCT this FROM this.sectionTimes st JOIN st.faculty f WHERE f.CNetId = :cNetId").setParameter("cNetId", cNetId).list(); Note, I don't know if the fact ...

24. filter problem on a set in hibernate 3.0beta1    forum.hibernate.org

25. Filters H3 beta    forum.hibernate.org

Hi, all i can't filter by parent property. h3 don't include filter restriction in sql where clause. Hibernate version: 3 beta Mapping documents:

26. Using typedef types in filter-def    forum.hibernate.org

27. Virtualization: Support for filter hierarchy?    forum.hibernate.org

Hi, we would like to use the Hibernate 3 Virtualization feature to implement data-dependent access restrictions. These access restrictions are defined for a specific user group. For each restriction, a specific filter is defined. => All filters of a specific group have to be combined via AND. This is what Hibernate does if you add multiple filters - excellent. => A ...

28. sess.filter(col...) in hibernate 3    forum.hibernate.org

29. Hibernate Filters    forum.hibernate.org

One other thing that I tried was instead of using named queries, I tried creating a query inline with SQL and using the filter. This produced the same error as described earlier. If I create the query with the filter disabled and the correct oql to do the filtering it works great.

30. Best Pratice For a filter replication job    forum.hibernate.org

31. Hibernate 3 filters and many-to-one    forum.hibernate.org

32. Include Filters in the many-to-one    forum.hibernate.org

34. Filtering records in xml    forum.hibernate.org

35. Cannot filter a Set object    forum.hibernate.org

I have a 4 tables which I would like to join and get the output. Hibernate version : 3.0 Mapping documents: : 1: 2: 3: ...

36. Incorrect when use filter with subselect!    forum.hibernate.org

Hibernate version: 3.0.5 I use a filter in entity MyEntity.hbm.xml : The HQL is: select e.id from MyEntity as e where e.param1 like ? and e.param2 = (select e1.param2 from MyEntity as e1 where e1.id = ? ) The Generated SQL is correct. But the result is null! If I modify the HQL to: select e.id ...

38. When using a filter, "Undefined filter parametet"    forum.hibernate.org

This is all with Hibernate 3.1rc2. I have a mapping like this: Code: .......

39. Filter not applied to Many-To-Many set    forum.hibernate.org

Got in entity, say X with @FilterDef(name = "filter", parameters = { @ParamDef(name = "falseVal", type = "integer") }) @Filters({ @Filter(name = "filter", condition = "(:falseVal = rating)") }) I have another entity Y that has a Set of X that is mapped with a @ManyToMany annotation, a join table is used to the relation. When i retrieve the entity from ...

40. Design - filter & listener or custom querty translator?    forum.hibernate.org

Hibernate version: 3.0.x I'm implementing security in an application and wanted to know the best way to use hibernate. A high level view of our scenario is that there is a tree of domain objects (about 40 different object types) and a user can see either all or none of that hierarchy depending on their relationship with that hierarchy. We have ...

41. Using filters on Sets    forum.hibernate.org

I am trying to use hibernate filters on sets. My example mapping is:

42. Configuration to filter all results by ...    forum.hibernate.org

Hi, I am trying to find a way to filter all results by current user's organization. Is there a place where I can specify the where clause like ORG_ID = 1 which is considered for loading all collections and named queries? Currently I am working on Hibernate 3.0 but can migrate to 3.1 if needed. Thanks, Ashish

43. Mult service calls w Hibernate Filters & OpenSessionInVi    forum.hibernate.org

I have a scenario where multiple service methods are used to display a page. ie: Code: request.setAttribute(ConstantsIF.DENTAL_FOCUS_LANDING_CONTENT,newsForYouService.findNewsForYouLandingPageLatestContent(applicationUser,ConstantsIF.NEWS_CATEGORY_DENTAL_FOCUS)); request.setAttribute(ConstantsIF.QUALITY_NEWS_LANDING_CONTENT,newsForYouService.findNewsForYouLandingPageLatestContent(applicationUser,ConstantsIF.NEWS_CATEGORY_QUALITY_NEWS)); request.setAttribute(ConstantsIF.INDUSTRY_NEWS_CONTENT,newsForYouService.findNewsForYouLandingPageLatestContent(applicationUser,ConstantsIF.NEWS_INDUSTRY_NEWS)); The data comes from the same table but data and associated collections etc are filtered differently depending on the service method called. The problem I'm experiencing is that I want the jsp page that is displayed to do the navigation through the ...

44. Filtering Sets    forum.hibernate.org

Newbie Joined: Mon Jan 02, 2006 9:10 am Posts: 10 Hi all! Second post of the night as I still have problems. Basically I want to "filter" a Set from loaded objects. For each period a consultant has a number of questionnaires. When I call Code: consultant.getQuestionnaires() I only want the questionnaires related to a specific period. I have been reading ...

45. Many-to-one filtering support    forum.hibernate.org

Are there plans to add many-to-one filtering? A common use is to filter on historical data as in the effective date example in the documentation. Filters work well if you are filtering against a collection or a class. The problem is that I also have many-to-one objects that are not supported by filters. An example, might be an Invoice with a ...

46. filter and <= =>    forum.hibernate.org

47. Filters and many-to-many    forum.hibernate.org

48. Hibernate Filters    forum.hibernate.org

HI there, I am trying to use Hibernate Filters. The filter tag is the place where it is possible to add a condition i.e. I am trying to apply a join in the above filter but hibernate gives an error. Another thing, my hibernate mapping file has a column which is a foreign key, i ...

49. Hibernate Querys and consecutive filtering    forum.hibernate.org

Hibernate version: 2 I have the following problem. I have a complex filter (or set of filters) that I may (or may not, this is done according to method args) apply to a given collection. It starts out with a standard query done in all instances that is something of the type. Collection myFilteredResults = new HashSet(); Collection result1 = session.createQuery("query1"); ...

50. Filters on a many-to-one    forum.hibernate.org

51. why the filter doesn't work on ?    forum.hibernate.org

.... .... ...

52. Simple Question : How do you filter ?    forum.hibernate.org

I am not sure how this is done, but the documents talks of writing SQL by hand. I have have a load of POJOs which map to tables, and the Web Developers want to send queries type request (i.e. to filter the returned set). So my question are 1. how do you filter for a particular class type 2. How do ...

53. Hibernate Filters    forum.hibernate.org

I'm just guessing but... You're using iheritance by joining. This means the hierarchy will be fetched in a single query which joins all the hierarchy tables. The filter stuff is added in the where clause of this query, verbatim. So it will apply to everything retunred by the query. There's no difference if you put it in the base class then. ...

54. hibernate and filter    forum.hibernate.org

55. Problem with Hibernate Filters.    forum.hibernate.org

Hibernate version: 3.1.2 I'm using Hibernate trough Spring and i want to enable 2 different Filters at the same time. But only first filter seems to work properly. The HBM-Files are generated via an Ant-Task. Here's a Code snippet of my Bean. Code: /** * @hibernate.class * table="TmAllowanceCalcDefinition" * @hibernate.cache * usage="read-write" * @hibernate.filter * ...

56. Problems using filters    forum.hibernate.org

//TODO: bad implementation, cos it depends upon ordering of mapping doc // fixing this requires that Collection/PersistentClass gain access // to the Mappings reference from Configuration (or the filterDefinitions // map directly) sometime during Configuration.buildSessionFactory // (after all the types/filter-defs are ...

57. one-to-many filter one-to-many set    forum.hibernate.org

Hi All I have 2 objects. I have a Parent class and a children class. This is a one-to-many relation. The parent has 0 or more children. The mapping works fine but the problem is I need to filter the children set. For example: The database has 1 parent (Parent1) and 3 children (Child1, Child2, Child3). When I execute the HQL ...

58. Hibernate Filters    forum.hibernate.org

59. Problem using filter-param    forum.hibernate.org

Hibernate version 3, Oracle DB. Having problem with simple sql when using hibernate filter with parameter. If i take the generated sql, set the filter param string value into it and run the query manually, it runs fine without error. Also, if I run the same query and use a hibernate filter that does not have parameters, then the query also ...

60. Trying to Avoid Subselects in Filters    forum.hibernate.org

Expert Joined: Sat Jan 17, 2004 2:57 pm Posts: 317 Location: In the basement in my underwear Need help with Hibernate? Read this first: http://www.hibernate.org/ForumMailingli ... AskForHelp Hibernate version: 3.2.1 GA Mapping documents: N/A Code between sessionFactory.openSession() and session.close(): N/A Full stack trace of any exception that occurs: No Exception Name and version of the database you are using: Oracle 10g ...

61. Filtering in a set    forum.hibernate.org

Hi: I would like some help about filtering in a set. ######################################################################## ... ######################################################################## ...

62. Filtering a Set based on a subset    forum.hibernate.org

Hi, I'm having a bit of a problem filtering out data in my query. The scanarion is something like this... Think of the Employee example from the documentation, this is the mapping for it. Quote: Code: ... ...

63. filter enable automatically ?    forum.hibernate.org

Beginner Joined: Mon Sep 27, 2004 11:51 pm Posts: 21 l have an DAO , it load all the borrows , Code: public Collection loadAllBorrow() throws DataAccessException { return getHibernateTemplate().executeFind(new HibernateCallback() { public Object doInHibernate(Session session) ...

64. Do I misunderstand filters?    forum.hibernate.org

Hibernate version: 3.1.3 Name and version of the database you are using: MySQL 5.0 I've had a filter defined for one of my entities for quite a while and thought it was working perfectly. It turns out it is only being applied when I run a query against that entity [eg, Criteria.list()]; it is not applied if I load an entity ...

66. How to escape in a filter class filter    forum.hibernate.org

67. How to define the filters in a central location.    forum.hibernate.org

Hibernate version: 3.2.0CR3 I am trying to define filters in a central location and refer to them in several classes. The way i mapped below generating compilation errors. filters.hbm.xml ============= ...

68. filter    forum.hibernate.org

69. Hibernate Filters    forum.hibernate.org

Hi, I am using Hibernate version: 3.1. I have a question regarding hibernate filters I have a filter on my set and My mapping document looks like this when i try to enable the filter it gives me org.hibernate.HibernateException: No such filter configured ...

70. Filter or not filter?    forum.hibernate.org

71. Disable/re-enable of Filter    forum.hibernate.org

Hibernate version: 3.2 I am using Hibernate Filters to implement temporal versioning of data. I have a routine that is used to update temporal data sets that should run without the filter. I therefore need to disable the filter before the update and reenable the filter after the update. I need to copy and save the current Filter parameters to set ...

72. Applying filter    forum.hibernate.org

Hi, Please take a look at Class A class A { @Column(name = "type") private String type; @OneToMany(...) @JoinColumn(name = "foo") private Set children = new HashSet(); } I want to load children only if type belongs to certain type. There may be many types, let's say A, B, C, D, E. If type == 'C' then I want to load ...

74. Filter-Def and NullPointerException at startup    forum.hibernate.org

Hi, I am using spring 2.5.2 LocalEntityManagerFactoryBean to load an EntityManagerFactory for which Hibernate 3.2.6 is the persistence provider. I define a Code: in global file and then reference it in class hbm files without the condition. Code: ...

75. Hibernate Filters are not working    forum.hibernate.org

Newbie Joined: Tue May 27, 2008 1:37 am Posts: 2 Location: Lahore Hi I have applied filter annotations but they are not working. Following is my Class UserProfile and then this class's service which returns data. But filters are not working there. I have enabled them and they are not working how to resolve this issue. i ve used Code: @FilterDef(name="adminFilter", ...

76. Trouble with filter    forum.hibernate.org

Hello everybody, I need your help. I implemented fulltext search in my entitys using lucene. Here is part of entity class. Code: @Indexed @FullTextFilterDefs({ @FullTextFilterDef(name = "company", impl = CompanyFilter.class, cache = false), @FullTextFilterDef(name = "roleFilter", impl = RoleFilter.class, cache = false) }) @Entity @Table(name="project") public class EdsProject extends EdsObject implements Indexable { ...

77. Can Filters be OR-ed together?    forum.hibernate.org

I'm exploring using Filters, and as far as I can tell multiple filters always translate to a number of WHERE clauses AND-ed together. I've Googled as well as I know how but I can't find any reference to OR-ing them, not even someone asking the same question! Is this possible? Thanks, Richard

78. Filter    forum.hibernate.org

This is regarding usage of Filters in Hibernate. When we define a filter and add it to a collection in a hbm.xml , activate the session for that filter and the execute a load or a query object within that session, is the filtering done by Hibernate by adding additional clause in WHERE in SQL generated or Filter is applied to ...

79. HIbernate Filters + User Defined Types    forum.hibernate.org

module.xxxx.model.type.LengthUnitType ...

80. Hibernate Filter    forum.hibernate.org

Hi! My problem is as follows. Thanks in advance for any kind of hint! I have a Java Class which represents a group, containing a Set of Objects of type "Employee". In my application you are able to delete such employees, but just in a logic way: A existing delete date indicates that a employee has been deleted. Let's say there ...

81. Applying a filter    forum.hibernate.org

Newbie Joined: Thu Oct 16, 2008 2:43 pm Posts: 1 Hi all. I'm having some problems to apply a filter in a list. I'm recovering the list like this: Code: Hibernate.initialize(PropertyUtils.getProperty(vo,nomeColDet)); And i need to apply this filter: Code: org.hibernate.Filter f = sess.enableFilter(fA.name()); Here is where i apply the filter: Code: protected void aplicaUmFiltro( Class classe, Filter fA) throws ...

82. Hibernate Filters    forum.hibernate.org

I'm Brazilian, thus most of the terms in the code are in portuguese. The first is the base class Pessoa ( People in english ): Code: package br.netsoft.beans; import java.io.Serializable; import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.EnumType; import javax.persistence.Enumerated; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Inheritance; import javax.persistence.InheritanceType; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Temporal; import javax.persistence.TemporalType; import ...

83. many-to-one and filters    forum.hibernate.org

Hi, I read some place that hibernate filters are not supported for single relationships. Im retrieving a large object graph, which is displayed in its completeness and actually has self referential relationships (i.e A person in Person is related to another person in the same Person table etc) Since it is effectively recursive and arbitrarily deep, getting the graph in one ...

84.  Filter Required    forum.hibernate.org

85. How to use Hibernate Filtering correctly?    forum.hibernate.org

86. HibernateException: No such filter configured !    forum.hibernate.org

import org.hibernate.annotations.*; @Entity @Table(name = "WORK_LOG", schema = "dbo", catalog = "PORTALNEW") @FilterDef (name = "createdDateWorklogFilter", parameters = { @ParamDef (name = "from", type = "java.util.Date"), @ParamDef (name = "to", type = "java.util.Date") }) @Filters( { @Filter (name = "createdDateWorklogFilter", condition = "CREATED_DATE >= :from and CREATED_DATE <= :to") }) ...

87. AbstractJarVisitor Filtering    forum.hibernate.org

Hi When I start my Java software, the first access to the database is slow. I use hibernate with the Java Persistence API. In the logfiles I see, the first access to hibernate generates following entry: AbstractJarVisitor:116 Searching mapped entities in jar/par: file:/xyz/myjarfile.jar AbstractJarVisitor:162 Filtering: packagename.Class1 AbstractJarVisitor:162 Filtering: packagename.Class2 ... Because there are so many classes in the jar file, the ...

88. Hibernate Filter with IN    forum.hibernate.org

Hi, In my project, I have one filter. In my entity class, I put @FilterDef and @Filter. @FilterDef(name="distribuidores", parameters={ @ParamDef(name="codDistribuidor",type="string")}) @Filter(name="distribuidores", condition="actcoddistribuidor in :codDistribuidor") The variable value is setting in authenticator moment normally, and it is Collection type. However, the filter is not setted in my entity query. If I change to condition="actcoddistribuidor = :codDistribuidor" and my variable to simple String, ...