Renaming persistent classes
Chris Muller
asqueaker at gmail.com
Mon Dec 13 03:41:05 UTC 2010
>> Now I can proccess 1250 transactions from a csv file in less than 3 SECONDS
>> including the time openning and proccessing of the file.
Great! It's illustrative of the strengths of those two different
parts of Magma.
>> Other thing, after the refactoring I'm getting an error when I change
>> anything on the class structure of any class. The error is:
>> "MaObjectSerializationSoftwareError: Individual not defined in this image".
>> That I did was rename two customer subclasses:
>> Previous:
>> Customer
>> Individual
>> Organization
>> Now:
>> Customer
>> NaturalPerson (Persona Física)
>> LegalPerson (Persona Jurídica)
>> It's strange to me because now all seem works ok and because when I rename
>> that classes haven't persistent instances on magma repository.
>>
>> Do you now that I'm doing wrong? Is it possible rename a persistent class?
Yes, but you must do it under a transaction. Begin, rename, commit.
If you didn't do it that way, then the repository will think it is
just a new class and you will have to "upgrade" your old instances
with a script.
See MagmaTestCase>>testClassSchemaUpgrades. It includes a rename test.
- Chris
> The only person who can help you with this is Chris. Because my
> knowledge about Magma in this area
> are close to zero :)
The other thing that can help everyone is the *code*. Answers to many
questions are easily found there. It is straightforward, especially
if you pay attention to the package each method is in; because that
reveals what "layer" it operates on.
- Chris
More information about the Magma
mailing list