Q: |
Can I update the generated C#/VB.NET files? |
A: |
Yes, you can. To update generated C#/VB.NET files, run the mt_dnom utility in the directory where these files are:
> mt_dnom -d mydatabase stubgen [-lang C# | VB] [-n namespace
] [-adc namespace] [-[no]psm] |
Q: |
Can I generate C#/VB.NET classes within a specific namespace? |
A: |
Yes, you can. Run the mt_dnom utility with
the -n option followed by a namespace. For example,
> mt_dnom -d mydatabase stubgen -n MyCompany.MyApp.MyModule |
Q: |
What is the procedure
for updating the definition of persistent C#/VB.NET classes? |
A: |
To update C#/VB.NET class definition (for
example to add or remove a property), update the database schema using
the ODL file, Rational Rose, or SQL DDL, and then run the mt_dnom
utility. |
Q: |
I need to serialize the objects that I retrieved from Matisse to send the objects' values to another system over the network. How can I easily implement it? |
A: |
The mt_dnom utility has an option -adc
to generate "Data Classes", which serves this purpose. Data classes
share with the stub classes all the properties defined in the database
schema, but do not include any database access methods. For more information,
look at the "Data Classes" section in the .NET Programmer's Guide. |
Q: |
I get the InvalidCastException error, when I retrieve objects from Matisse database, for example, using a lookup method. How can I fix the error? |
A: |
The error is happening because the Matisse .NET binding cannot find your persistent classes. When your persistent classes are defined in a specific name space or in a separate assembly, you need to give these information to the Connection object so that the Matisse .NET binding can find these classes when returning objects.
For example, suppose your persistent classes are defined in an assembly Schema. Then, you need to pass an MtPackageObjectFactory object as the additional argument for the MtDatabase constructor.
MtDatabase db = new MtDatabase("host", "db", new MtPackageObjectFactory(",Schema"));
For more information, see the section 7.1 "Connection with ObjectFactory" in the .NET Programmer's Guide.
|