Re: [mdr-users] Java attributes in JMI code

SainTiss <[email protected]> Tue, 20 Sep 2005 09:26:50 +0200
Newsgroups gmane.comp.java.netbeans.modules.mdr.user
Message-ID <[email protected]>
Hi Martin,

Ok, I understand. I'm actually (mis)using MDR as some sort of OO
database with OCL as the query language, so that's why I need these
awkward features.

Nevertheless, I found a workaround: Apparently, you can just specify
java.util.HashMap as a MOF type, and MDR will generate JMI interfaces
for it. Next, you just delete the generated HashMap interfaces and use
Java's java.util.HashMap instead. Setting and getting HashMap attributes
like this seems to work at least, even though I understand this is
ugly...

Anyway, I understood that MOF2 supports platform-specific types, and
otherwise, in the long run, I probably need to use something else than
MDR...

Kind Regards,

Hans

On Mon, 19 Sep 2005 23:54:18 +0200
Martin Matula <[email protected]> wrote:

> Hi Hans,
> this is not possible. In fact, it should not even be possible to model
> 
> java.lang.Object. The fact that it works is just a side-effect of a 
> relaxed checking.
> You can use only MOF types in your metamodels.
> Martin
> 
> SainTiss wrote:
> 
> >Hi,
> >
> >Is it somehow possible to model an attribute in a MOF model as being
> >e.g. of type "java.util.HashMap"?
> >Modeling attributes of type "java.lang.Object" seems to work, and
> >they show up in the JMI interfaces, if Object is modeled as a MOF
> >PrimitiveType. However, MOF seems to prefix all similar
> >PrimitiveTypes with "java.lang", while for HashMap I need java.util.
> >Putting HashMap in a java.util package doesn't seem to work, as JMI
> >code generation apparently ignores that...
> >
> >Any suggestions?
> >
> >Thanks,
> >
> >Hans
> >  
> >
>
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFDL7m/XlnUYIbmLOQRAqk4AJ9Z86vbss/tNOIj1LZg4X1Uz5qknACgmWLF
VDpsWFyWFT+unAywIUlo/0k=
=2UiY
-----END PGP SIGNATURE-----