Re: [jopr-dev] EntityBean Mapping?
by mazz@redhat.com
if you are adding your own entity beans, they need to go into the "domain" module.
You are putting your new entity beans in this module, right?
modules/core/domain
They must go in there, we build the ejb-jar out of here, not the enterprise/server/jar module.
If you did that, make sure you rebuild the module so it can test it (this tests that hibernate can load everything) - so do a "mvn install" from the core/domain module. Note that you can quickly add a unit test to make sure your named …
[View More]queries can be found/parsed by hibernate - just add your bean to org.rhq.core.domain.test.QueryAllTest in the ENTITY_NAMES static final. Or add additional unit tests in that domain module (there are examples in there to follow).
----- "Bruno Wassermann" <bruno.wassermann(a)googlemail.com> wrote:
> Hi again,
>
> I am having a little trouble integrating a simple EntityBean of my
> own. I have defined DependencyBean (which will take care of
> inter-host/domain dependencies among discovered resources). This
> entity bean defines a number of named queries via the @NamedQuery
> annotation. Unfortunately, when I then try and use it (any of the
> named queries) in a SLSB, Hibernate complains about not being able to
> find the query. if I try to just use the query string itself (with
> named parameters), it will complain of not being able to locate the
> named parameters.
>
> This makes me suspect that there is some step missing, maybe a mapping
> has to be added manually somewhere (persistence.xml) or something else
> I am missing? I have modelled the entity bean on
> org.rhq.core.domain.resource.Resource. Is there some magic step I have
> to take in the build process or somewhere else?
>
> Just to clarify, this bean currently/temporarily lives in
> enterprise.server.discovery and is one of the extensions I need for my
> use case.
>
> Many thanks,
>
> -- Bruno
>
> _______________________________________________
> jopr-dev mailing list
> jopr-dev(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/jopr-dev
[View Less]
15 years, 6 months
EntityBean Mapping?
by Bruno Wassermann
Hi again,
I am having a little trouble integrating a simple EntityBean of my own. I
have defined DependencyBean (which will take care of inter-host/domain
dependencies among discovered resources). This entity bean defines a number
of named queries via the @NamedQuery annotation. Unfortunately, when I then
try and use it (any of the named queries) in a SLSB, Hibernate complains
about not being able to find the query. if I try to just use the query
string itself (with named parameters), it will …
[View More]complain of not being able to
locate the named parameters.
This makes me suspect that there is some step missing, maybe a mapping has
to be added manually somewhere (persistence.xml) or something else I am
missing? I have modelled the entity bean on
org.rhq.core.domain.resource.Resource. Is there some magic step I have to
take in the build process or somewhere else?
Just to clarify, this bean currently/temporarily lives in
enterprise.server.discovery and is one of the extensions I need for my use
case.
Many thanks,
-- Bruno
[View Less]
15 years, 6 months