[OGM] MongoDB JPQL Query: comparison with object fails
by Guillaume SCHEIBEL
Hello,
I found an problem with the MongoDBComparisonPredicate. When I try to make
a jpql query with an object comparison [1]
The value (here a SolutionType instance) is "directly" passed to the
MongoDBComparisonPredicate which tries to use it as it is, in a DBObject
query.
The point is, the refering property is solutionType_id (which is correct)
but instead of using the parameter id, it's using the complete object [2]
The MongoDB drivers returns that it can't serialize the type passed in
parameter..
There is something I don't get, why for basic CRUD operations do we use
dehydrated object and for queries as well ? Object parameter (all paramater
that are not String, or wrappers) would be easier to use.
WDYT ?
Guillaume
[1] https://gist.github.com/gscheibel/7070143
[2]
https://github.com/hibernate/hibernate-ogm/blob/master/mongodb/src/main/j...
12 years, 2 months
[OGM] JPQL support
by Guillaume SCHEIBEL
Hello,
I can confirm that JPQL queries are only working if they are executed from
a org.hibernate.Session. If we want to run them from the entity manager, we
get a OGM-21 thrown from the OgmEntityManager.createQuery(String query)
method.
How can wa / I make it work ?
Thanks
Guillaume
12 years, 2 months
[OGM] Integration test
by Guillaume SCHEIBEL
Hello,
I'm writing a quick sample application using OGM. In this application I'm
using a JP-QL query
"From DatabaseVendor d"
this query is executed by the EntityManager therefore I get an OGM21
exception. So I wrote a unit test to exclude the query parser and it
passed. Then I'm trying to reproduce the error with an integration test.
I have:
- enhanced the ModuleMenberRegistrationScenario,
- copied my Jboss7.1.1 as integrationtest/mongodb/target/jboss-eap-6.1
When I'm running the tests, (the MONGODB_HOSTNAME, and MONGODB_PORT set),
the server is starting, it's creating the archive to deploy and nothing.
The console doesn't show any deployement of the test-archive.
And then nothing ... it seems the server (or something else) is waiting for
something to happen, but what ?
I've created a gist: https://gist.github.com/gscheibel/7060445 with the
server log.
Any thought ?
Thanks
Guillaume
12 years, 2 months
[OGM] support for remote grids
by Sanne Grinovero
Hi all,
it looks like I will be very busy on Search and some more Infinispan
integrations in the coming couple of months, but there are some very
exciting things that I would love to see in OGM soon, and since I
heard there is a lot of excited people out there waiting for this too,
this is your chance to grab some more glory.
As you know we have several GridDialects, one of the first one was
supporting Infinispan but only in "embedded mode".
Embedded mode was the first choice because it's easier, and also because:
- it supports transactions
- had some form of query capability (although we never used it)
- lowest latency, assuming your data set is reasonable
But people looking at OGM are especially fascinated by the idea to use
it in a more traditional architecture, which implies having a
"database" as a separate independent service.
Infinispan 6.0 is almost ready, and thanks to Gunnar includes a bit of
OGM in its DNA to support queries defined from a remote client (Hot
Rod client).
I think it would be terrific if someone could start hacking on a
HotRodDialect, and start writing tests to stress this new query
capability; specifically I had the Gunnar - Davide team in mind if
they can :-)
We'll have to ignore transactions for now, I guess it could be
considered like we do with MongoDB: make it clear the backend is not
transactional in the docs.
Timing-wise, if we could have a prototype using HQL queries very very
soon, that would be a great help to the Infinispan team as it would
validate the new feature; this idea of mine is probably too late as
Infinispan is already at CR2 phase (tomorrow) but you might be able to
put some basic checks in place on time?
Second priority - also relatively urgent - is to move on to latest ORM
version, so that possible complexities can be softened in ORM before
4.3 is declared Final.. it's still using the outdatet 4.2.0.CR1 !?
We should get it to work on WildFly quickly.
Sanne
12 years, 2 months
generated code in hibernate
by Jonathan Bernwieser
Hi there,
I am currently doing my Bachelor thesis at TU Munich, at the Software
Engineering chair of Prof. Broy.
The goal of this thesis is to create a tool to automatically categorize
source code in open source software. Different categories will be "test
code", "generated code" and "productive code" to better evaluate and use the
results of quality-check techniques. (Static analyses might detect certain
quality problems even though they're not relevant for a certain code
category. One example would be the amount of clones found in a project. It
has to be checked what kind of category the evaluated code belongs to as
clones aren't causing quality issues if they occur in "generated code".)
In order to create and test heuristics to identify code categories, I first
need to create manually a collection of different projects (or classes to be
more specific) I actually know about what kind of category they belong to.
While manually going through the hibernate project I couldn't find any files
that were automatically generated. Is that correct or are there any
generated classes I didn't recognize?
Thanks you for your help.
Looking forward to hearing from you,
Regards,
Jonathan
12 years, 2 months