Can MyBatis handle a dynamic schema?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Can MyBatis handle a dynamic schema?

Derek Eskens
Hello,
 
Let me preface that I know next to nothing about MyBatis. Someone suggested I look into it for a problem I'm trying to solve.
 
So the application we're building will be deployed to client locations. Those locations have a database that we gave them when we initially installed our legacy application.  Those databases are in various states depending on which updates they did or hot-patches that were applied.  So basically we have an idea of what columns _could_ be in a table, but every location is different.
 
Our legacy application handles this by querying the schema and altering CRUD statements based on what it knows about the schema.  It ends up putting the result set into a grid type data structure.
 
So our ideal solution is to find Java tools that will be able to handle these various schema and map the result sets to some kind of entity model - how we do that is what's up for debate and in search of a solution.
 
I'm hoping this community can tell me if MyBatis is uniquely positioned to handle a scenario like this or if I should continue my look elsewhere.
 
Thanks,
-Derek Eskens

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: Can MyBatis handle a dynamic schema?

Frank Martínez
Hi Derek,

With automapping Mybatis will populate your beans only with columns retrieved from the database, so you can use SELECT * FROM ... 

But in the case of inserts or updates it could be more tricky. 

With mybatis 3.2+ your SQL statements can be velocity templates, so you can do a lot of crazy things.

Cheers,

Frank.



On Wed, May 29, 2013 at 6:14 PM, Derek Eskens <[hidden email]> wrote:
Hello,
 
Let me preface that I know next to nothing about MyBatis. Someone suggested I look into it for a problem I'm trying to solve.
 
So the application we're building will be deployed to client locations. Those locations have a database that we gave them when we initially installed our legacy application.  Those databases are in various states depending on which updates they did or hot-patches that were applied.  So basically we have an idea of what columns _could_ be in a table, but every location is different.
 
Our legacy application handles this by querying the schema and altering CRUD statements based on what it knows about the schema.  It ends up putting the result set into a grid type data structure.
 
So our ideal solution is to find Java tools that will be able to handle these various schema and map the result sets to some kind of entity model - how we do that is what's up for debate and in search of a solution.
 
I'm hoping this community can tell me if MyBatis is uniquely positioned to handle a scenario like this or if I should continue my look elsewhere.
 
Thanks,
-Derek Eskens

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Frank D. Martínez M.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: Can MyBatis handle a dynamic schema?

Ray Sprinkle
A more effective solution would be to generate the mapping files from the schema as part of the installation step.

On 5/30/2013 11:11 AM, Frank Martínez wrote:
Hi Derek,

With automapping Mybatis will populate your beans only with columns retrieved from the database, so you can use SELECT * FROM ... 

But in the case of inserts or updates it could be more tricky. 

With mybatis 3.2+ your SQL statements can be velocity templates, so you can do a lot of crazy things.

Cheers,

Frank.



On Wed, May 29, 2013 at 6:14 PM, Derek Eskens <[hidden email]> wrote:
Hello,
 
Let me preface that I know next to nothing about MyBatis. Someone suggested I look into it for a problem I'm trying to solve.
 
So the application we're building will be deployed to client locations. Those locations have a database that we gave them when we initially installed our legacy application.  Those databases are in various states depending on which updates they did or hot-patches that were applied.  So basically we have an idea of what columns _could_ be in a table, but every location is different.
 
Our legacy application handles this by querying the schema and altering CRUD statements based on what it knows about the schema.  It ends up putting the result set into a grid type data structure.
 
So our ideal solution is to find Java tools that will be able to handle these various schema and map the result sets to some kind of entity model - how we do that is what's up for debate and in search of a solution.
 
I'm hoping this community can tell me if MyBatis is uniquely positioned to handle a scenario like this or if I should continue my look elsewhere.
 
Thanks,
-Derek Eskens
--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Frank D. Martínez M.
--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.