Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > LLBLGen Pro Runtime Framework> 2 way Projection
 

Pages: 1
LLBLGen Pro Runtime Framework
2 way Projection
Page:1/1 

  Print all messages in this thread  
Poster Message
Dan1
User



Location:

Joined on:
20-Sep-2007 16:09:06
Posted:
41 posts
# Posted on: 20-Sep-2007 21:04:45.  
Is it possible to do two way projection (project changes from BO back into the database/DL).

Also, can I project hiearchial data to a BO? So there is a one to many entity relationship and a BO which itself contains a List of custom related business objects.

Thanks !


Dan
  Top
Walaa
Support Team



Location:

Joined on:
21-Aug-2005 16:03:48
Posted:
14626 posts
# Posted on: 21-Sep-2007 12:21:49.  
Quote:
Is it possible to do two way projection (project changes from BO back into the database/DL).

It's possible to have 2-way projection.
Quote:
Also, can I project hiearchial data to a BO? So there is a one to many entity relationship and a BO which itself contains a List of custom related business objects.

In v.2.5, it's now possible to perform a hierarchical projection of a full entity graph, using an entity collection as a startpoint. The projection can be onto a dataset (which will get one datatable per entity type, including datarelations) or a dictionary/hashtable with per type an entitycollection with the projection results per entity type found in the graph.


  Top
Dan1
User



Location:

Joined on:
20-Sep-2007 16:09:06
Posted:
41 posts
# Posted on: 21-Sep-2007 20:56:29.  
Thanks,

You didn't mention projecting into a List<T> object of the parent entitiy with each BO in the list containing a List<T> of the child BO.

I want to go from

ParentEntity 1---Many> ChildEntity

to

ParentBO 1----Many> ChildBO

You mention you can do this in a dataset or dictionary object, but what about a custom class (BO)
  Top
daelmo
Support Team



Location:
Guatemala City
Joined on:
28-Nov-2005 23:35:24
Posted:
8138 posts
# Posted on: 22-Sep-2007 09:14:36.  
You could do that. Please go to LLBLGenPro Help - Using generated code - (Adapter || SS) - Fetching Datareaders an projections - Resulset projections - Projecting Dynamic List resultset onto custom classes.

David Elizondo
LLBLGen'ing (articles and code snippets) | linkedin | twitter
 
Top
Dan1
User



Location:

Joined on:
20-Sep-2007 16:09:06
Posted:
41 posts
# Posted on: 25-Sep-2007 17:40:47.  
That doesn't do what I want to do exactly. It is telling me how I can project to a List of Custome Class. This is what I am already doing. I want to take it 1 step further.

I have already used the code snippet from the help as a template to do what I want to do with projection. Here is what I have so far.

If you look at the WeldSpec_Spot class below you will see that there is a WeldSpec_Spot_WeldNo property which is a ListOf WeldSpec_Spot_WeldNo BO's. I want the resultset that is returned to project the data into child lists of the BO for each item in the main list of custom BO's.

Do you know what I mean?


Thanks...

Public Class WeldSpec_Spot


    'Public [AssyId] As System.Int32

    Private _AssyID As Integer
    Private _WeldSpec_SpotID As Integer
    Private _WeldGroup As String
    Private _Quantity As Nullable(Of System.Int32)
    Private _NuggetDiameter As Nullable(Of System.Decimal)
    Private _UndersizeNuggetDiam As Nullable(Of System.Decimal)
    Private _MaxIndent As System.String
    Private _MinAcceptanceCriteria As System.String
    Private _MaterialThickness_Governing As Nullable(Of System.Decimal)
    Private _WeldSetupSize_Required As Nullable(Of System.Decimal)
    Private _WeldSpec_Spot_WeldNo As New Collections.Generic.List(Of Business.WeldSpec_Spot_WeldNo)


    Public Property WeldSpec_Spot_WeldNo() As Collections.Generic.List(Of Business.WeldSpec_Spot_WeldNo)
        Get
            Return _WeldSpec_Spot_WeldNo
        End Get
        Set(ByVal value As Collections.Generic.List(Of Business.WeldSpec_Spot_WeldNo))
            value = _WeldSpec_Spot_WeldNo
        End Set
    End Property


    Public Property WeldSetupSize_Required() As Nullable(Of System.Decimal)
        Get
            Return _WeldSetupSize_Required
        End Get
        Set(ByVal value As Nullable(Of System.Decimal))
            _WeldSetupSize_Required = value
        End Set
    End Property

    Public Property MaterialThickness_Governing() As Nullable(Of System.Decimal)
        Get
            Return _MaterialThickness_Governing
        End Get
        Set(ByVal value As Nullable(Of System.Decimal))
            _MaterialThickness_Governing = value
        End Set
    End Property

    Public Property MinAcceptanceCriteria() As System.String
        Get
            Return _MinAcceptanceCriteria
        End Get
        Set(ByVal value As System.String)
            _MinAcceptanceCriteria = value
        End Set
    End Property

    Public Property MaxIndent() As System.String
        Get
            Return _MaxIndent
        End Get
        Set(ByVal value As System.String)
            _MaxIndent = value
        End Set
    End Property

    Public Property UndersizeNuggetDiam() As Nullable(Of System.Decimal)
        Get
            Return _UndersizeNuggetDiam
        End Get
        Set(ByVal value As Nullable(Of System.Decimal))
            _UndersizeNuggetDiam = value
        End Set
    End Property

    Public Property NuggetDiameter() As Nullable(Of System.Decimal)
        Get
            Return _NuggetDiameter
        End Get
        Set(ByVal value As Nullable(Of System.Decimal))
            _NuggetDiameter = value
        End Set
    End Property

    Public Property AssyId() As Integer
        Get
            Return _AssyID
        End Get
        Set(ByVal value As Integer)
            _AssyID = value
        End Set
    End Property

    Public Property WeldSpec_SpotId() As Integer
        Get
            Return _WeldSpec_SpotID
        End Get
        Set(ByVal value As Integer)
            _WeldSpec_SpotID = value
        End Set
    End Property

    Public Property WeldGroup() As String
        Get
            Return _WeldGroup
        End Get
        Set(ByVal value As String)
            _WeldGroup = value
        End Set
    End Property

    Public Property Quantity() As Nullable(Of System.Int32)
        Get
            Return _Quantity
        End Get
        Set(ByVal value As Nullable(Of System.Int32))
            _Quantity = value
        End Set
    End Property

    Public Sub New()
        
    End Sub

End Class
  Top
Walaa
Support Team



Location:

Joined on:
21-Aug-2005 16:03:48
Posted:
14626 posts
# Posted on: 26-Sep-2007 16:54:47.  
Quote:
If you look at the WeldSpec_Spot class below you will see that there is a WeldSpec_Spot_WeldNo property which is a ListOf WeldSpec_Spot_WeldNo BO's. I want the resultset that is returned to project the data into child lists of the BO for each item in the main list of custom BO's.

I'm confused by the above lines.
I don't if you mean by BOs the Entities generated by LLBLGen Pro or some custom classes.
So I don't know whther you want to project data from an Entity graph to custom classes, or from custom classes to an entity graph.


  Top
Dan1
User



Location:

Joined on:
20-Sep-2007 16:09:06
Posted:
41 posts
# Posted on: 27-Sep-2007 21:18:48.  
I've eventually figured it out myself. Thanks. I just project the data to the custom class and then project the child objects to the List in each class by using a For loop. It's more manual than I thought, but it works.
  Top
Pages: 1  


Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.12172008 Final.