New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
spec: self referecing and direct sql #18
Comments
is this solved now ? since the adapter specs are passing now. |
after the refactoring, the specs are all green. |
@mkristian, i don't think it's solved, we just run tests against original 'abstract adapter' now . Previously that was 'abstract adapter' with some additional specs copied over from other dm-core specs. I think that's why we are now green. But that's only partially true, we are green for: Mysql, Postgres, h2. Derby and Hsql are still work in progress. |
@douglasrodrigo , i think we can keep this ticket closed. On the other hand it would be great to have possibility to run dm-core specs with our adapter. AFAIR in order to run dm-core specs with, let's say, postgres we have to just set proper ADAPTER var:
My question is if that ^ will play nice with ruby-maven and our adapter? More info here: https://github.com/datamapper/do/wiki/jruby |
I will have a look and make it work with ruby-maven. the rvm use jruby is probably not needed. another question is where the dm-hibernate code is coming from, i.e. it might need to add it into the Gemfile as well. let's see. |
Ok, I will try reproduce with older specs version just to see if is still broken. |
@douglasrodrigo please stop :) we don't need this now. Let's wait for possibility to run real dm-core specs. Then we will have a lot of fixing to do ;) |
ok, it's a good idea. |
https://gist.github.com/1292550 still running the in-memory specs but that could work ;-) the Gemfile I changed the source for the plugins like dm-migration - i.e. just take the gem from rubygems. simliar for the dm adapters as well. and I needed to add the dm-hibernate-gem at the end. |
not sure if that runs the right adapter but all the jars are in the classpath. |
will take a look a little bit later (daily job) |
Kristian, so many specs broken???? We can create a integration test environment of the adapter running dm specs in the cloudbees. |
$ ADAPTER=hibernate rake spec things are shaping but you need to add a Mavenfile and use the singular ADAPTER env |
first I see duplicate class definitions, so we need to use the reload mode of the adapter to run the test and how to configure the whole thing I do not know |
with cloudbees - yes sound good, actually the jruby-maven-plugins also run there though I did not set it up myself. but maybe we wait until we have some passing specs ;-) |
I'm having some problems with installing git gem. Any workaround? |
Same problem here. http://rubygems-proxy.torquebox.org/releases/rubygems/git/1.2.5/git-1.2.5.pom Acessing on browser show an exception. |
My steps:
my console log: |
I was I day offline and have to find out that you guys had again a problem I had not. maybe fixing the git gem version to '1.1.0' might help too. |
I had to do some hacks with fake git.pom in order to run specs. Had |
in spec/dm_core/spec_helper.rb was (it is gone now): Hibernate.reset_config which just resets the Hibernate config completely which is used in case of "conflict" when :allow_reload is configured on the adapter. I will play around with the specs this evening ;-) |
Ok, please add |
I am trying hard to get my TODO list small again. so it was busy week for me, hope next week I will find time for dm-hibernate again. |
I'm busy too :) |
Executing adapter spec I got a error, but creating the same Friend resource on the irb I got things working:
executing with irb:
system :005 > Friend.first.creator
Friend.first.creator
Hibernate:
select
this_.id as id2_0_,
this_.creator_id as creator2_2_0_,
this_.name as name2_0_
from
friends this_
where
(
this_.id=?
) limit ?
=> #<Friend @id=1 @name="god" @creator_id=1>
Adapter spec:
[INFO] 1)
[INFO] NativeException in 'DataMapper::Adapters::HibernateAdapter self referecing and direct sql should create a self referencing enitity'
[INFO] org.hibernate.PropertyAccessException: Exception occurred inside setter of rubyobj.Friend.creator_id
[INFO] org/hibernate/property/BasicPropertyAccessor.java:89:in
set' [INFO] org/hibernate/tuple/entity/AbstractEntityTuplizer.java:352:in
setPropertyValues'[INFO] org/hibernate/tuple/entity/PojoEntityTuplizer.java:232:in
setPropertyValues' [INFO] org/hibernate/persister/entity/AbstractEntityPersister.java:3580:in
setPropertyValues'[INFO] org/hibernate/engine/TwoPhaseLoad.java:152:in
initializeEntity' [INFO] org/hibernate/loader/Loader.java:877:in
initializeEntitiesAndCollections'[INFO] org/hibernate/loader/Loader.java:752:in
doQuery' [INFO] org/hibernate/loader/Loader.java:259:in
doQueryAndInitializeNonLazyCollections'[INFO] org/hibernate/loader/Loader.java:2232:in
doList' [INFO] org/hibernate/loader/Loader.java:2129:in
listIgnoreQueryCache'[INFO] org/hibernate/loader/Loader.java:2124:in
list' [INFO] org/hibernate/loader/criteria/CriteriaLoader.java:118:in
list'[INFO] org/hibernate/impl/SessionImpl.java:1597:in
list' [INFO] org/hibernate/impl/CriteriaImpl.java:306:in
list'[INFO] org/hibernate/property/BasicPropertyAccessor.java:89:in
set' [INFO] org/hibernate/tuple/entity/AbstractEntityTuplizer.java:352:in
setPropertyValues'[INFO] org/hibernate/tuple/entity/PojoEntityTuplizer.java:232:in
setPropertyValues' [INFO] org/hibernate/persister/entity/AbstractEntityPersister.java:3580:in
setPropertyValues'[INFO] org/hibernate/engine/TwoPhaseLoad.java:152:in
initializeEntity' [INFO] org/hibernate/loader/Loader.java:877:in
initializeEntitiesAndCollections'[INFO] org/hibernate/loader/Loader.java:752:in
doQuery' [INFO] org/hibernate/loader/Loader.java:259:in
doQueryAndInitializeNonLazyCollections'[INFO] org/hibernate/loader/Loader.java:2232:in
doList' [INFO] org/hibernate/loader/Loader.java:2129:in
listIgnoreQueryCache'[INFO] org/hibernate/loader/Loader.java:2124:in
list' [INFO] org/hibernate/loader/criteria/CriteriaLoader.java:118:in
list'[INFO] org/hibernate/impl/SessionImpl.java:1597:in
list' [INFO] org/hibernate/impl/CriteriaImpl.java:306:in
list'[INFO] /home/douglas/projetos/jibernate-dm/lib/dm-hibernate-adapter.rb:176:in `read'
The text was updated successfully, but these errors were encountered: