Re: JPA and desktop apps

Поиск
Список
Период
Сортировка
Искать
От
Guy Rouillier
Тема
Re: JPA and desktop apps
Дата
Msg-id
4C512019.9010000@burntmail.com
Ответ на
Список
Дерево обсуждения
JPA and desktop apps Craig Ringer <craig@postnewspapers.com.au>
Re: JPA and desktop apps Samuel Gendler <sgendler@ideasculptor.com>
Re: JPA and desktop apps Craig Ringer <craig@postnewspapers.com.au>
Re: JPA and desktop apps <rsmogura@softperience.pl>
Re: JPA and desktop apps Lew <noone@lewscanon.com>
Re: JPA and desktop apps Craig Ringer <craig@postnewspapers.com.au>
Re: JPA and desktop apps Guy Rouillier <guyr-ml1@burntmail.com>
Re: JPA and desktop apps Craig Ringer <craig@postnewspapers.com.au>
Re: JPA and desktop apps Guy Rouillier <guyr-ml1@burntmail.com>
On 7/28/2010 10:21 PM, Craig Ringer wrote:
> On 28/07/10 04:35, Guy Rouillier wrote:
>
>> Our team is proficient in SQL and JDBC, so we wanted something that
>> would take care of all the routine housekeeping but would not be as
>> bloated as JPA or Hibernate.  We settled on MyBatis
>> (http://www.mybatis.org/) formerly iBATIS.
>
> How did you find that it played with Pg features like:
>
> - Custom and domain types
> - User/role security
> - column privileges

Custom types: you can implement your own TypeHandler and simply tell 
MyBatis to use that for specific columns.  I do that, for example, to 
map columns containing foreign key values into Java enums.  The mapping 
works in both directions, so once you've updated the value of a Java 
enum in an object and want to update the DB, MyBatis will map the enum 
back into the proper column value using your TypeHandler.  Of course, 
all the default TypeHandlers are built in.

Per-user logins: I haven't done that in over 10 years, i.e., long before 
I started using MyBatis.  Just about everything I've been working on 
uses web-based GUIs with server-based database interactions.  MyBatis 
comes packaged with 3 DataSource options that all use a single set of 
credentials.  You can provide your own DataSource implementation.

Column privileges: from the way you describe this, it sounds like you 
have some way of identifying which user logons have update rights on 
which columns.  If that is the case, then MyBatis provides minimalist 
conditional expressions.  Here is a ready example from some production code:

    where
       user_id = #{aUserId, javaType=String, jdbcType=VARCHAR}
       
       and trunc(timestamp)  trunc(#{dtStartDate, 
javaType=java.util.Date, jdbcType=DATE})
       
       
       and type_id in
          
          #{item}
          
       

The code is for a where clause, but you can do the same thing in the set 
clause of an update.

I'm not a MyBatis developer, just a happy end user.  It works well for 
what it attempts to do.  But it certainly doesn't attempt to do anywhere 
near what JPA or Hibernate does.

-- 
Guy Rouillier
В списке pgsql-jdbc по дате отправления
От: Craig Ringer
Дата:
Сообщение: Re: JPA and desktop apps
От: Matthew Wakeling
Дата:
FAQ