Does mybatis support non-crud operations?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Does mybatis support non-crud operations?

mrweiliangzhang
For example, We can use "show status" to see the monitoring information of MySQL in MySQL command line.

Can I use this in mybatis?

--
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/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Does mybatis support non-crud operations?

mybatis-user mailing list

On 5. Jun 2017, at 05:09, [hidden email] wrote:

For example, We can use "show status" to see the monitoring information of MySQL in MySQL command line.

Can I use this in mybatis?

If it works in JDBC it works in MyBatis. 

--
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/d/optout.

--
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/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Does mybatis support non-crud operations?

Iwao AVE!
In reply to this post by mrweiliangzhang

In JDBC, SHOW STATUS can be executed as a select statement.

So, it is possible in MyBatis as well.

@Results({
  @Result(column = "Variable_name", property = "variableName"),
  @Result(column = "Value", property = "value")
})
@Select("show status")
List<MySqlStatus> getMySqlStatus();

MySqlStatus is a POJO.

public class MySqlStatus {
  private String variableName;
  private String value;
  // getters/setters
}

The result map (i.e. @Results) can be omitted if mapUnderscoreToCamelCase is enabled in the config.

Regards,
Iwao


2017-06-05 12:09 GMT+09:00 <[hidden email]>:
For example, We can use "show status" to see the monitoring information of MySQL in MySQL command line.

Can I use this in mybatis?

--
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/d/optout.

--
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/d/optout.
nm
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Does mybatis support non-crud operations?

nm
Hi,

Not sure if it  supports the "show status;" query, but I suppose you can try it by enclosing the query in a  <select> tag. If that does not work, how about fetching the status directly from the information_schema? Something like the below query :

<select id="getStatus" resultMap="statusDetails">
    select * from information_schema.SESSION_STATUS
</select>

Regards,
Nitesh

On Mon, Jun 5, 2017 at 3:42 PM, Iwao AVE! <[hidden email]> wrote:

In JDBC, SHOW STATUS can be executed as a select statement.

So, it is possible in MyBatis as well.

@Results({
  @Result(column = "Variable_name", property = "variableName"),
  @Result(column = "Value", property = "value")
})
@Select("show status")
List<MySqlStatus> getMySqlStatus();

MySqlStatus is a POJO.

public class MySqlStatus {
  private String variableName;
  private String value;
  // getters/setters
}

The result map (i.e. @Results) can be omitted if mapUnderscoreToCamelCase is enabled in the config.

Regards,
Iwao


2017-06-05 12:09 GMT+09:00 <[hidden email]>:
For example, We can use "show status" to see the monitoring information of MySQL in MySQL command line.

Can I use this in mybatis?

--
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/d/optout.

--
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/d/optout.

--
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/d/optout.
Loading...