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

Pieter Van Gorp <[email protected]> Tue, 20 Sep 2005 14:04:27 +0200
Newsgroups gmane.comp.java.netbeans.modules.mdr.user
Message-ID <[email protected]>
Dag Hans,
> Anyway, I understood that MOF2 supports platform-specific types, and
> otherwise, in the long run, I probably need to use something else than
> MDR...
MDR is voor jou slecht een middel om OCL support te krijgen voor
in-memory objects.  Mijns inziens moet je niet echt naar iets anders
overschakelen zolang die OCL support OK is... maar we hebben 't hier
al 'ns over gehad hé :)  Take care.

Mvg,
P

On 9/20/05, SainTiss <[email protected]> wrote:
> 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
> > >
> > >
> >
> 
> 
>