No code created, just a "return true"

Posts   
 
    
Sokon1
User
Posts: 97
Joined: 17-Jul-2006
# Posted on: 16-Aug-2006 11:56:02   

Hi,

I added a table to my entities and let LLBLGen Pro create the code like always. When I tried to use the code, the "delete"-command didn't work. I looked into the created code and found this:


...

/// <summary> Refetches the Entity from the persistent storage. Refetch is used to re-load an Entity which is marked "Out-of-sync", due to a save action. Refetching an empty Entity has no effect. 
/// Because this entity doesn't have a primary key defined, this routine does nothing. </summary>
/// <returns>true</returns>
public override bool Refetch()
{
   return true;
}
        
/// <summary> Deletes the Entity from the persistent storage. This method succeeds also when the Entity is not present.</summary>
/// <param name="deleteRestriction">Predicate expression, meant for concurrency checks in a delete query. Overrules the predicate returned by a set ConcurrencyPredicateFactory object.</param>
/// <returns>true if Delete succeeded, false otherwise</returns>
public override bool Delete(IPredicate deleteRestriction)
{
   return true;
}
        
/// <summary> Performs the update action of an existing Entity to the persistent storage. Because this entity doesn't have a primary key defined, this routine does nothing. </summary>
/// <returns>true</returns>
protected override bool UpdateEntity()
{
   return true;
}
        
/// <summary> Performs the update action of an existing Entity to the persistent storage. Because this entity doesn't have a primary key defined, this routine does nothing. </summary>
/// <param name="updateRestriction">Predicate expression, meant for concurrency checks in an Update query</param>
/// <returns>true</returns>
protected override bool UpdateEntity(IPredicate updateRestriction)
{
   return true; 
}

...

There's only a "return true" where i expected code like in the other created classe. Why?

Thanks in advance!

knnth
User
Posts: 4
Joined: 14-Feb-2006
# Posted on: 16-Aug-2006 12:24:19   

Does the entity have a primary key defined?

Sokon1
User
Posts: 97
Joined: 17-Jul-2006
# Posted on: 16-Aug-2006 12:57:40   

knnth wrote:

Does the entity have a primary key defined?

Yes it has a primary key. In the database the PK exists, too.

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 16-Aug-2006 14:13:05   

Just make sure your entity has a PK set in the LLBLGen Pro Designer annd also check if you have another fields listed in the designer.

If everything seems fine, would you please define which templates do you use to generate the code. And which version of the LLBLGen Pro you are using & the Designer version (release)

Sokon1
User
Posts: 97
Joined: 17-Jul-2006
# Posted on: 17-Aug-2006 09:17:19   

The Pk is set (I can read the code hints wink ). What do you mean with other fields? There were other fields of the table listed in the designer, yes.

I'm using LLBLGen Pro v2.0.0.0 and self servicing. The template set is "SD.TmplateBindings.SqlServerSpecific.NET20".

But that's just for the records. In the meantime the designer created the correct code and everything seems alright. I can't remember having changed a thing. Anyway, thanks again for your time! simple_smile