Filtering child entities

Hello !
I have situation where depending on several conditions I construct a query step by step .
This is the code :(Article has 2 relationship with F1 and F2)
Dim list1 As IEnumerable(Of Article)
        list1 = From t In context.Articles.Include("F1").Include("F2") Order By t.name Ascending
                    Select t
        If condition1 then
            list1 = list1.Where(Function(t2) t2.tp = 1)
        End If
        If condition2 then
            list1 = list1.Where(Function(t2) t2.id = 7)
        End If
        Myreport.datasource=list1.ToList()
This code is working , but now I want to add a new condition , and if this is true the child "F1" should be filtered.
How can I filter the Child "F1" 
Thank you !

Hello,
From my experience, the LINQ query could not perform a step by step query as you described, I suggest that you could try with the ESQL as darnold mentioned or post a wish to the team to below site so that the team might consider adding it to the further version:
https://data.uservoice.com/forums/72025-entity-framework-feature-suggestions
Regards.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • Rollup of Subtraction of Child Entities

    Hello All,
    How can I achieve Roll up of Subtraction of two child entities into Parent Entity.
    for example I have
    A (Parent Entity)
       |--------A&B (Child 1)
       |--------B (Child 2)
    We want to upload summation of A&B trail in Child 1 and only B trail as Child 2 and want to calculate Parent A as Subtraction of both Child 1 & Child 2.
    what are the possible ways to achieve this, please share your views.
    Thanks & Regards.

    Hi,
    Suggest you do a sign flip of data loaded for child B so that when you consolidate A it will give you the required result.
    To still get data of B appearing correctly create reports for B with reverse sign flip in FR.
    Hope this helps.
    Regards,
    Darshana

  • Possible to get filtered child information on the parent's browse screen?

    We're writing a 'case management' system that revolves around an event in the workplace-- slip and fall, burned your lip on hot coffee in the kitchen, etc.
    Related to a 'case' are people-- witnesses, investigators, etc.  As you might imagine in the database structure the 'case' is the head of the octopus, with witness and investigator tables linked to it in a 1-to-many fashion.
    Right now we're trying to craft a screen whereby we pass in a a 'Person' as a screen parameter-- and I don't mean the built-in 'Person' type from LS, but an entity of our own making.  We would like to see on the screen all cases involving that person,
    whether they're an investigator or witness or other.  (The witness and investigator and other entities have related links to the Person entity, so for Investigator #342 you know who that is.)
    On this screen we're working on, as one of the datasources, we have the Case table, and have selected the 'Edit Query' link to filter the listing of cases to only those involving our 'Person' parameter.
    Here's where I'm getting a bit lost.  In the filter screen itself I can easily craft something based on the fields in the Case table, but is it possible to filter based on related entities to the Case, like the Investigators or Witnesses?  Maybe
    I'm missing something obvious but I don't see any provision for child entity properties as filters.
    I'm pretty sure we can do a workaround by creating multiple tabs on this screen, so that for a given person we can see individual tabs listing cases in which they're Investigators or Witnesses.  But is it possible to list this all out without tabs?
     Or at least without advanced stuff like getting creative with WCF RIA services?
    In short, the question is this: can I list on one screen all cases involving a person no matter their role?  Or do I need individual tabs for each role (Investigator, Witness, etc?)

    Yes you can by creating a custom query on case. Use the PreProcess query event to filter the cases in code.
    Dave
    Dave Baker | AIDE for LightSwitch | Xpert360 blog | twitter : @xpert360 | Xpert360 website | Opinions are my own. For better forums, remember to mark posts as helpful/answer.

  • [solved] JPA - persisting parent & child entities in one hit

    Hi,
    I have an object say, "Bus" and it has a one to many relationship to another object, "Commuter". Suppose i create one Bus instance and one commuter instance and associate them to each other and i want them to save to the database and store the relationship via a foriegn key relationship in the Commuter table, what would the pojo look like? What exact annotations would i require for it to work. Working examples appreciated!

    Thanks for the link, and thats exactly why i want to do this (adf).
    However, the sample does not demonstrate the code for creating a new Department with a Employee at the same time, and wiring up the relational foriegn key.
    Any ideas on how to extend this example to do this? I'd like a form create one entity of each in one action. I followed some advise before to create my own persist() function which persists the Employee object first, then the Department object.
    They both successfully persist but the foriegn key does not get mapped in the table. Any sample code available?

  • Parent-Child post order exception; FK constraint violation

    I've seen the discussion and answer recently in this forum for configuring BC4J
    to post the parent first, then the child, to avoid the FK constraint exception??
    So I have to appologise for re-asking, but I can't get the search function to find
    any thing that needs multiple key words. :(
    I've got two Entities, parent child, with Links, and Association between them on the FK.
    What was the trick to get the framework to correctly post the parent first??
    I've looked over the FkLink and FkAssoc and all these components are included by
    the AppModule...
    Thanks, curt

    Edit the association object between your parent and child entities and set the "Composition" flag (Composite Assocation in the UI), to true. You may elect to enforce "CascadeDelete" option, if you have database Cascade-delete turned on between the associated tables and want to avoid multiple DMLs for the details.

  • How to model parent child relationship with DPL? @Transient?

    Hello All,
    I want to model a parent entity object with a collection of child entities:
    @Entity
    public class Parent{
    @PrimaryKey
    String uuid;
    List<Child> children;
    @Entity
    public class Child{
    @PrimaryKey
    String id;
    I know that the DPL won't support automatic persistence where it'll recursively go through my parent bean and persist my children with one call. Is there a way of applying the equivalent to JPA's @Transient annotation on "children" so I can persist the children manually and have the engine ignore the collection?
    If not and I want to return to the user a Parent with a List named "children," do I have to create a new object which is identical to Parent, but doesn't have the BDB annotations and manually assemble everything? If possible, I'd like to avoid defining redundant objects.
    Thanks in advance,
    Steven
    Harvard Children's Hospital Informatics Program
    Edited by: JavaGeek_Boston on Oct 29, 2008 2:22 PM

    Hi Steven,
    The definition of persistence is here:
    http://www.oracle.com/technology/documentation/berkeley-db/je/java/com/sleepycat/persist/model/Entity.html
    And includes this: "All non-transient instance fields of an entity class, as well as its superclasses and subclasses, are persistent. static and transient fields are not persistent."
    So you can use the Java transient keyword. If that isn't practical because you're using transient in a different way for Java serialization, see the JE @NotPersistent annotation.
    In general a parent-child relationship between entities is implemented almost as you've described, but with a parentId secondary key in the Child to index all children by their parent. This enables a fast lookup of children by their parent ID.
    I suggest looking at this javadoc:
    http://www.oracle.com/technology/documentation/berkeley-db/je/java/com/sleepycat/persist/SecondaryIndex.html
    as it describes all types of entity relationships and the trade-offs involved. The department-employee relationship in these examples is a parent-child relationship.
    --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • EJB-3 Shouldn't persiting/removing child objects be reflected in OneToMany?

    I'm a bit puzzled by behaviour I'm finding. (Toplink)
    I modify the list of children under an entity, removing some child entities and inserting others.
    The odd thing is that I seem to have to do two things each time. To add a child I set the child's parent pointer to the existing entity and persist is, but I also have to add the child to the OneToMany collection.
    Conversely, on delete, I have to remove the child both from the collection and the entityManager.
    Shouldn't the changes in the collection be automatic? Or, conversely, given that the parent link it mandatory, shouldn't removing the child from the collection suffice to delete it?
    ps. to clarify:
    If I don't change the OneToMany collection object the child changes aren't reflected even though I find the parent entity again.
    Message was edited by:
    malcolmmc

    I'm afarid not - a generic feature that will allow to
    delete orphan children didn't make it into the final
    spec.
    regards,
    -marinaDo you happen to have any links to public discussions about this feature with regard to the development of the spec? This is a very nice feature in Hibernate and it's absence in EJB 3.0 is rather disappointing.
    Thanks.

  • How to validate presence of child rows

    Hello,
    I'm running Studio Edition Version 11.1.2.3.0
    I have a parent entity that has 3 child entities. I need to create a validation rule to check that at least one of the 3 child entities has a row in it.
    Can people please advise?
    Many thanks.
    Edited by: user576183 on Oct 30, 2012 11:36 AM

    Hi,
    You can create a script validation rule using groovy expression.
    Check out this pdf on how to use the groovy to get values from other entities. http://www.oracle.com/technetwork/developer-tools/jdev/introduction-to-groovy-128837.pdf
    -Arun

  • Displaying different child data within another grouped child.

    Hi,
    I'm trying to configure a Siebel BI report and have come up against an issue I'm hoping someone can help with. I have a parent entity (not sure what this would be called in BI terms, en element?) which has several child entities.
    The parent entity is a repeating group and has a child entity within it which is also grouped. Within that child grouping I would like to list (and ultimately filter) another child entity but I cannot it to display any records. If I remove it from the child grouping the records are displayed fine.
    Sorry if the above is not clear!

    Do paste your XML here and let us know the requirement.

  • Linking Multiple regions in a single page

    Hi All,
    I am a new user to Apex, and i need some help for my current requirement. i will appreciate any help from the members
    i have a Master table and 5 child tables. i have created an interactive report in region1 for the master and 5 simple reports for the childs in region2 to region6 on a single page.
    my requirement is that, if i filter the master table(interactive report on region1) on column fk_id which is a foreing key for all the childs (say fk_id=457), i would like to see childs to display detail records only for the fk_id=457.
    is this possible in Apex?
    i am also open to change the current design of all in 1 page to many page reports
    The main requirement of this application is to maintain these 1 master and 5 child entities, have forms to add/delete/update rows and have reports with search capability
    i am open to any suggestions which will accomplish this requirement.
    Thanks,
    Vijay

    Hi Aaron,
    Thanks for the info. but i need some more help to close this.
    1. How do i set page item P1_Filter. i believe it should store the filed value of the filter being applied in Master.
    2. The master in region1 is Interactive report and user can filter on any item. I need the child reports to filter only when the master is filtered on fk_id column and show all records for other filters on master.
    in this case how do i set page item P1_Filter only for fk_id.
    3. also if the report is not filtered on fk_id, then P1_Filter will be null and my child reports will not show any records. in default settings i can set only 1 value but i need to show all records if P1_Filter is null.
    Any help is appreciated.
    Thanks,
    Vijay

  • How to use one application with multiple schema without copying application?

    Hi,
    Previously we are using oracle forms and by that we can manage by using a set of folders containing fmx and use different schema/database for different customers. so the source code comes from one individual file but used for different database users.
    is it possible to do this without copying application in apex?
    reason is because if applications are copied for each customer, and in a situation where a page has a bug, the developer must correct multiple pages across all the application. This would not be appropriate to manage.
    could this be done in apex? or is there any other approach?

    Hi,
    An application is tied to its parsing schema, so it is not possible to have one code base which you can then point to different schemas. I have seen some threads relating to dynamically setting the parsing schema, but I don't think it has worked to well, and would not be a supported configuration by Oracle.
    The normal way to do this is to have one schema and for each entity where it is logical you will have an extra key which is the customer id. I mention where it is logical, because not every entity needs its own data defined by customer. Some data will be common across all customers, such as lookup data and some entities will comprise child entities by which the data separation will be implied by the parent. You can then use Oracle's Virtual Private Database feature to implement a seperate view of the data through the application, based most likely on the customer who is logged on.
    Hope this helps.
    Regards
    Andre

  • Autocommit and Cursor commit Behaviour

    Hi,
    I need help to set and get the Autocommit and Cursor commit behavior attributes
    in Oracle.
    AUTOCOMMIT:
    For DDL Statement, this attribute is set while executing the OCIStmtExecute() api
    as below:-
    r = OCIStmtExecute(d->svc, d->sql, d->err, 1,0,
    (CONST OCISnapshot *) NULL,
    (OCISnapshot *) NULL,
    d->transaction ? OCI_DEFAULT :                                         OCI_COMMIT_ON_SUCCESS);
    For DML Statement, from the OCI documentation the database parameter attributes
    support OCI_ATTR_AUTOCOMMIT_DDL with the values OCI_AC_DDL and OCI_NO_AC_DDL.
    Since this is a parameter attribute, I couldn't set using OCIAttrSet() API.
    I need help in implementing AUTOCOMMIT for both DDL / DML statements.
    CURSOR COMMIT BEHAVIOUR:
    Similarly, I have observed that Oracle support cursor commit behavior attributes
    using OCI_ATTR_CURSOR_COMMIT_BEHAVIOR and the attribute values are OCI_CURSOR_OPEN and OCI_CURSOR_CLOSED.
    I have tried setting this attribute as below:-
    ub1 nCommitType = OCI_CURSOR_OPEN;
    oraRC = OCIAttrSet((dvoid *)d->svc, (ub4)OCI_HTYPE_SVCCTX,
         (dvoid *)&nCommitType,
         (ub4)sizeof(nCommitType),
         OCI_ATTR_CURSOR_COMMIT_BEHAVIOR, d->err);
    This always fails with the error ORA-24315: illegal attribute type.
    I need help in setting this attribute using OCI.
    Another approach to set Autocommit / Close Cursor attributes:-
    Oracle support SET commands for autocommit and closecursor, I have prepared
    and executed these set commands using OCIStmtPrepare and OCIStmtExecute api. The OCIStmtExecute() API fails to execute the below command texts.
    SET AUTOCOMMIT ON/OFF
    SET CLOSECURSOR ON/OFF
    Is it the right method of setting these attributes?
    Thanks,
    Sankar.P.

    Hi.
    You are trying to commit "child" information before your Parent information is commited.
    Can you describe how you dragged & droped your views?.
    Dragged relationship views or single views?.
    Can you put output log with jbo with FINEST level?.
    To find a solution try next solutions:
    1) Disable "strong" association between your parent-child entities. To achieve it follow next steps:
    - Go to your "Assoc" that describes your foreign key.
    - In "Realtionship" tab, "Behaviour" disable "Composition Association".
    Image: http://1.bp.blogspot.com/-Em8NZvjOUzo/T_NQbJTcLjI/AAAAAAAAAm4/hPsDwtEhJQ4/s1600/4.png
    2) Drag and Drop correct views as a Master-Detail (cascading views in your Data Control).
    http://2.bp.blogspot.com/-1By5vNNGMFQ/T_NQdYzexKI/AAAAAAAAAnE/DGn7Gr0RSDw/s1600/6.png (in spanish).
    In the image, drag & drop PortalwebView2 is the correct way for Master-Details tables. Probably you dragged PortalwebView1 that have dependecy to master table.
    Steps that you have followed:
    - Drag & Drop dependen View Object as a Master-Detail with two tables.
    - Add Create operations from these views to create Rows.
    - Add Commit general operation from Data Control.
    Try to drag & drop Master-Detail views correctly before disable association.
    PD: To try your model faster run Model project instead of your application.
    Regards.
    Edited by: Daniel Merchán on 30-jul-2012 12:05

  • Losing SFSB after exception thrown - how can I avoid this?

    I am using Sun Java System Application Server 9.0
    I am using a State Full Session Bean (SFSB) via a Remote Business Interface. In this SFSB I do a �try/catch� to perform an update on an entity with child entities. My catches look for an OptimisticLockException and any other exception. When Oracle throws an OptimisticLockException the catch does not recognize this and catches the any other exception. In both case another exception is thrown, see below for the code. But when this happens the SFSB is destroyed and no longer available causing the client to fail when it tries to use one of the SFSB�s business interface methods.
    Can anyone please tell me how I avoid losing the SFSB or how to reload it automatically and quickly?
    A plus would be can you tell me why the Oracle exception is not caught by the correct catch? The full exception is oracle.toplink.essentials.exceptions.OptimisticLockException and I have no idea whether is a subclass of another exception type.
    } catch (OptimisticLockException ole) {
         Debug.debugPrintln("OrderControllerBean.updateOrder() - optimistic lock exception: " + ole.getMessage());
         throw new EntityAlreadyUpdatedDeleted("Order number: "
                        + oldOrderHeader.getOrderNumber()
                        + "cannot be updated because it has changed or been deleted since you last looked at it");
    } catch (Exception ex) {
         Debug.debugPrintln("OrderControllerBean.updateOrder() - other exception persist failed orderNumber: "
                        + oldOrderHeader.getOrderNumber()
                        + " exception: " + ex.getMessage());
         throw new EJBException(ex);
    Many thanx����.
    Edited by: jdraven on Mar 27, 2008 11:06 PM

    No worries!
    Thank you for sharing the solution to your problem with the community!
    Kameralina
    Ask NI (ni.com/ask)
    Search The KnowledgeBase
    NI Developer Zone
    Measure It. Fix It. ni.com/greenengineering/
    NI Vision ni.com/vision/

  • Multiple TableExtension/Tableview in a single view...

    Hi,
           I'm facing a problem creating multiple TableExtension elements in a single view. The relationship between the business objects is like this.
    Header--->Order(s)--
    >Item(s)
    As you can see, each header can have multiple orders and each order can have multiple items.
    The number of orders is known only during runtime..
                  In the last page of my bsp application, created using component workbench, I should allow the user to view/edit item list of all orders found under a particular header. That is to say, the view should contain multiple EditList tables for editing items.
               But, I have only one context node for Item and I'm able to show only one table at a time. One solution that works, but not usable in my case is to use navigation buttons to change the Order focus entity. When the focus changes, the Item table shows relevant child entities of that particular order. But, only single table in that view and so, useless.
             Classic BSP application is a big NO. The table should allow customizing viewable columns and have toolbar buttons. The Chtmlb:tableExtension is very suitable and convenient while working with BOL objects, but how to generate multiple tables that are independent of each other?
    Please provide some pointers...
    Thanks,
    Arun Prakash
    Edited by: Arun Prakash Karuppanan on Jun 21, 2008 11:49 PM

    Hi,
          Got it. I used field symbol for specifying the table and looped the tableview tag the number of times I wanted. Each time, the tableview and configtable IDs are also generated uniquely, as I would need them later.  Each time, the field symbol is assigned by a method implemented in the controller. This controller method, creates a internal table dynamically and populates it with relevant data fetched from my BOL collection. Ofcourse, I need to implement a separate iterator class for the ConfigTable and use appropriate events to make changes to my BOL collection. It's a little bit complicated, but not impossible.
    Regards,
    Arun Prakash.

  • Error While Promoting the Numbers to Next Level

    We have hierarchy defined for entities in Hyperion and are using Phased submissions under Process control . We have all the immediate child entities at 'SUBMITTED' phase but when we are promoting the Parent entity to 'SUBMITTED' phase we are getting following error
    "Cannot promote a process unit to a level higher than any of its direct dependents."
    I know that a parent can be promoted only to a level that is less than or equal to the lowest level of its immediate children.
    However we have few of the Entities which are at "NO ACCESS" stage or "Not Started" stage so if this affecting the Parent from promoting to next stage. But these entities are not started only and the Parent Entity has already been promoted from Not Started to "First Pass" stage that point of time no error crept in.
    Please let me know the probable cause of the error.
    Regards
    Rahul
    Edited by: rj_700 on Jun 9, 2012 11:35 AM

    Hi Rahul ,
    I am a learner.
    As per my Knowledge.
    When we have issues about Phased Submission- Process Control there are certain things which are worth making note of.
    1. Validation Accounts ,which might be preventing you from Promoting the Phase to the next level.
    2.And Before promoting the submission group to the Next Phase, make sure all your child members have passed all the review levels to be promoted to next level
    please check with experts if my reply is inappropriate.
    Thanks,
    David

Maybe you are looking for

  • 10.6.4 complete system freeze when resuming from screensaver-VMWare Fusion

    I have a Macbook Pro, 3,1. I just upgraded to 10.6.4 and noticed the following symptoms: Shortly after launching VMWare Fusion 3.1 running a Windows XP VM (from a Bootcamp partition), a series of pop up messages were complaining about a bad OpenGL dr

  • DNS not working properly

    Hello, Since a couple of days I got DNS problems. (DNS not working properly). This started happening after a Windows update. I tried to deinstall all of them and see if that helped but it did not.  I'm quite inexperienced with this. Hope someone can

  • How do I move email in aol folders to my gmail account?

    I figured out how to move current email in aol to a folder in gmail. How do I move aol folders of email to gmail, where I want them to remain in those folders?

  • Is there a way to allow only selected 17+ apps

    My daughter is 14. I would like to allow all 14+ apps, and also allow selected (but not all) 17+ apps. Is there a way to do that?

  • Create Data type table in 46B

    Hi Quick one, can I dynamically create tables in 46B using the 'create data dref type table of ty_table' in 46B.  It seems not but I just wanted to check.  Otherwise I will resort to using the construct below: CALL METHOD cl_alv_table_create=>create_