New Posts New Posts RSS Feed: Can synthetic properties be used in OQL (Object Query Language)?
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Can synthetic properties be used in OQL (Object Query Language)?

 Post Reply Post Reply
Author
Customer View Drop Down
Senior Member
Senior Member
Avatar
User Submitted Questions to Support

Joined: 30-May-2007
Location: United States
Posts: 260
Post Options Post Options   Quote Customer Quote  Post ReplyReply Direct Link To This Post Topic: Can synthetic properties be used in OQL (Object Query Language)?
    Posted: 12-Jul-2007 at 3:07pm

The table has columns ActualStartTime, AdjustedStartTime, ActualFinishTime and AdjustedFinishTime.

 
We added properties JobStartTime and JobFinishTime to the table entity (see the following code).
 
Can JobStartTime and JobFinishTime be used in OQL?
If not, can we write an OQL based on database that provide the same results?
 
     ''' -----------------------------------------------------------------------------
    ''' <summary>
    ''' JobStartTime, ActualStartTime otherwise AdjustedStartTime if actual not available
    ''' </summary>
    ''' ----------------------------------------------------------------------------
    Public ReadOnly Property JobStartTime() As Date
        Get
            Dim aJobStartTime As Date
            Try
                If Me.ActualStartTime.HasValue Then
                    aJobStartTime = Me.ActualStartTime.Value
                Else
                    aJobStartTime = Me.AdjustedStartTime.Value
                End If
            Catch
                aJobStartTime = Nothing
            End Try
            Return (aJobStartTime)
        End Get
    End Property
 
    ''' -----------------------------------------------------------------------------
    ''' <summary>
    ''' JobFinishTime, ActualFinishTime otherwise AdjustedFinishTime if actual not available
    ''' </summary>
    ''' ----------------------------------------------------------------------------
    Public ReadOnly Property JobFinishTime() As Date
        Get
            Dim aJobFinishTime As Date
            Try
                If Me.ActualFinishTime.HasValue Then
                    aJobFinishTime = Me.ActualFinishTime.Value
                Else
                    aJobFinishTime = Me.AdjustedFinishTime.Value
                End If
            Catch
                aJobFinishTime = Nothing
            End Try
            Return (aJobFinishTime)
        End Get
    End Property
Back to Top
IdeaBlade View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 30-May-2007
Location: United States
Posts: 353
Post Options Post Options   Quote IdeaBlade Quote  Post ReplyReply Direct Link To This Post Posted: 12-Jul-2007 at 3:07pm
This would be a great feature to have, but unfortunately it is extremeful difficult to implement as the database doesn't understand synthetic, and because the query needs to behave properly in a variety of different environments including Cache only, Database only, and Cache and Database).
 
Sometimes, you can make on OQL query by translating the query to use only database properties.  For example, if I want all employees only than 30 years old, I can ask for all empluees born after March 14, 1977.
 
In other cases.  I can load some subset of entities into the cache, and filter the entities in the cache.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down