The entity does not contain the definition

Posts   
 
    
madhavi
User
Posts: 25
Joined: 16-Jan-2006
# Posted on: 17-Nov-2006 20:22:52   

Hi,

I am having an issue with the generated entities. It says that the entityFieldIndex does not contain the definition of the column that we added to the table.

I did not have this issue before I converted the lgp file from 9i to 10g. After converting I am able to generate the entities and every thing works fine.

But when i tried to add a new cloumn and generated the entity, it did generate but its throwing error in the application when I am accessing that field.

I appreciate any help.

Thanks, Madhavi.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39927
Joined: 17-Aug-2003
# Posted on: 18-Nov-2006 12:10:41   

You're sure the property is available in the class definition of the entity and the code compiles fine, AND the assembly of the generated code you're using in the application is indeed the newest build of that generated code so includes the property in the class?

Frans Bouma | Lead developer LLBLGen Pro
madhavi
User
Posts: 25
Joined: 16-Jan-2006
# Posted on: 20-Nov-2006 15:54:05   

Hi there!!

We were able to generate entites and didn't get any error. We copied all the files to our project and when tried to compile the application, got error that application doesn't contain definition for the new columns that we added to the existing table. We can see the events, which were creted when we generated the entities.

Thanks in advance, Madhavi

jbb avatar
jbb
User
Posts: 267
Joined: 29-Nov-2005
# Posted on: 20-Nov-2006 16:00:37   

Hello,

did your application use fields that you have no updated in the designer(when you want to update your databasegenerics, you have to refresh from catalog but also select 'add new entities map on table from catalog').

Could you post some lines of your code on which the compilation failed?

madhavi
User
Posts: 25
Joined: 16-Jan-2006
# Posted on: 20-Nov-2006 16:15:19   

Yes, I did referesh the catalog and it did add the new columns to the entities. The entity contains all the events related to the newly added fields, bit it says that the definition for the EntityFieldIndex is not found. Here is the lines of code related to that field.

It would say that this fieldIndex definition is not found CombatDeterminationDecisionFieldIndex.UnempBenefitStartDate

public virtual System.DateTime UnempBenefitStartDate { get { object valueToReturn = base.GetCurrentFieldValue((int)CombatDeterminationDecisionFieldIndex.UnempBenefitStartDate); if(valueToReturn == null) { valueToReturn = TypeDefaultValue.GetDefaultValue(typeof(System.DateTime)); } return (System.DateTime)valueToReturn; } set { if(SetNewFieldValue((int)CombatDeterminationDecisionFieldIndex.UnempBenefitStartDate, value)) { OnUnempBenefitStartDateChanged(); } } }

Thanks, Madhavi.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39927
Joined: 17-Aug-2003
# Posted on: 21-Nov-2006 09:49:26   

Could you check if this property is indeed present in the enum defined in ConstantsEnums.cs ? Also, at the top of hte files, there's a timestamp, are these the same or is ConstantsEnums.cs older?

Frans Bouma | Lead developer LLBLGen Pro
madhavi
User
Posts: 25
Joined: 16-Jan-2006
# Posted on: 22-Nov-2006 14:18:09   

Thanks for your reply!!

I checked the file and these fields are not there. Date stamp ia old one too. Not the date when we generated these entites. Should we manually add these fields? We never had this problem before we upgraded to 10g. What should we do to prevent this to happen in future?

Do we need to copy all the files from DBSpecific folder after we upgraded to 10g? We just copied PersistenceInfo.cs file.

Thanks in advance, Madhavi

jbb avatar
jbb
User
Posts: 267
Joined: 29-Nov-2005
# Posted on: 22-Nov-2006 15:19:06   

Hi,

You should regenerate all the project and it will replace all the old files because the persistenceinfo.cs doesn't contains all. If there is any problem you should see it in the generator log and check for read only or protected files.