Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Using JRuby with myBatis ?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Roger Gilliar  
View profile  
 More options Aug 24 2012, 1:53 pm
From: Roger Gilliar <ro...@gilliar.de>
Date: Fri, 24 Aug 2012 19:53:30 +0200
Local: Fri, Aug 24 2012 1:53 pm
Subject: [jruby-user] Using JRuby with myBatis ?
Does anyone know how to use myBatis with JRruby ?

I tried the following:

require "rubygems"
require "java"
require 'jruby/core_ext'

java_import "org.apache.ibatis.io.Resources"
java_import "java.io.InputStream"
java_import "org.apache.ibatis.session.SqlSessionFactory"
java_import "org.apache.ibatis.session.SqlSessionFactoryBuilder"

inputStream = Resources::getResourceAsStream("mybatis-config.xml")

class Vkprlist
        attr_accessor :name
end

Vkprlist.become_java!

sqlSessionFactory = SqlSessionFactoryBuilder.new.build(inputStream)

But I get:

### Error building SqlSession.
### The error may exist in VkprlistMapper.xml
### Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.lang.RuntimeException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class . Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'Vkprlist'.  Cause: java.lang.ClassNotFoundException: Cannot find class: Vkprlist
  (root) at test.rb:18

Regards
  Roger

BTW: I'm using JRuby-1.6.7.2
---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Christian MICHON  
View profile  
 More options Aug 26 2012, 5:13 am
From: Christian MICHON <christian.mic...@gmail.com>
Date: Sun, 26 Aug 2012 11:13:13 +0200
Local: Sun, Aug 26 2012 5:13 am
Subject: Re: [jruby-user] Using JRuby with myBatis ?

On Fri, Aug 24, 2012 at 7:53 PM, Roger Gilliar <ro...@gilliar.de> wrote:
> Does anyone know how to use myBatis with JRruby ?

No, and not familiar with it... From google, I can see it does help
connecting to SQL and it's in java.

So quite likely you're using jdbc. After reading some of the
documentation, it looks much more complex than traditional ruby ORM
like Sequel/DataMapper/ActiveRecord with jdbc connectors.

Though it's always nice to use pure java libraries in jruby, for this
once, I would strongly advise to stick to simple ORM mentioned above,
unless all your business logic is already mapped using myBatis.

(I for one use Sequel)

--
Christian

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
kristian  
View profile  
 More options Aug 26 2012, 5:30 am
From: kristian <m.krist...@web.de>
Date: Sun, 26 Aug 2012 15:00:33 +0530
Local: Sun, Aug 26 2012 5:30 am
Subject: Re: [jruby-user] Using JRuby with myBatis ?
just have a look at the Vkprlist which java class it is after
Vkprlist.become_java!

Vkprlist.java_class

it should be something like
rubyobj.Vkprlist

this is the one you need to use for myBatis xml-config.

I never used myBatis but what you wrote sounded familiar to what we
tried to do with

https://github.com/mkristian/jibernate

(which we postponed until datamapper-2.0 shaping up)

- Kristian

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
kristian  
View profile  
 More options Aug 26 2012, 5:31 am
From: kristian <m.krist...@web.de>
Date: Sun, 26 Aug 2012 15:01:28 +0530
Local: Sun, Aug 26 2012 5:31 am
Subject: Re: [jruby-user] Using JRuby with myBatis ?
wrong it is now

https://github.com/mkristian/dm-hibernate-adapter

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Roger Gilliar  
View profile  
 More options Aug 27 2012, 5:09 pm
From: Roger Gilliar <ro...@gilliar.de>
Date: Mon, 27 Aug 2012 23:08:50 +0200
Local: Mon, Aug 27 2012 5:08 pm
Subject: Re: [jruby-user] Using JRuby with myBatis ?
Hi thanks for the reply. But using rubyobj.Vkprlist instead of Vkrplist leads to the same error.

Regards  Roger

Am 26.08.2012 um 11:30 schrieb kristian <m.krist...@web.de>:

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions Older topic »