mybatis-cli 0.0.7 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0edf891648b7f289e8651a08b7c4b99419a0e813
4
- data.tar.gz: 0264234374c7dc37e19b490d4923500e94fe630e
3
+ metadata.gz: bd9dc702039466296371f1ca07eb495204fd1d32
4
+ data.tar.gz: b06b438dbf63af998602e95a9d1d432f53f07968
5
5
  SHA512:
6
- metadata.gz: 607453d54651b9ecb6f0b6965080f7496e812a367d33eafc550ef70a2f2e4bc275465a9f38f7d94de81dcfbab4586be453e1acf00d5ebe920f24984cd4e2bc07
7
- data.tar.gz: 7e671d7c349a6283ebca66030f13c3e7031efac9bd69bcb8e8779c54802810df8b2dc713a60049b478f8e6460a6bd58a0a8f05e076f50f04da6857ef0c15f428
6
+ metadata.gz: f5dd3e0723cba83c3a9360f734331ef5cef917c5d7e815df143d140fb3cca0c8ae755d5457fe8bf4a0c1780813005fd1fbcaa5b606b60e5a884557c78336cded
7
+ data.tar.gz: f655c4778439ebbac3abdaf17359c9d99153cc19cf8422481bdac7afe11b0657e2a3edbca33290ffb13f166bd451a95c67561ade172994da23a2e233d4cdd1a2
@@ -16,7 +16,8 @@ module Mybatis
16
16
  file.puts "<!DOCTYPE mapper PUBLIC \"-//mybatis.org//DTD Mapper 3.0//EN\""
17
17
  file.puts " \"http://mybatis.org/dtd/mybatis-3-mapper.dtd\">"
18
18
  file.puts
19
- file.puts "<mapper namespace=\"#{self.get_class_path context}Mapper\">"
19
+ mapper_folder = "#{self.get_mapper_folder context}"
20
+ file.puts "<mapper namespace=\"#{mapper_folder}Mapper\">"
20
21
  file.puts " <resultMap id=\"BaseResultMap\" type=\"#{self.get_class_path context}\" >"
21
22
  context.attributes.each_with_index do |attr|
22
23
  file.puts " <result column=\"#{attr.column_name}\" property=\"#{attr.field_name}\" />"
@@ -64,6 +65,16 @@ module Mybatis
64
65
  puts "create file: #{file_path}"
65
66
  end
66
67
 
68
+ def get_mapper_folder(context)
69
+ result = "#{context.po_name}"
70
+ if context.mapper_package != ''
71
+ result = "#{context.mapper_package}.#{context.po_name.upcase_first}" if context.mapper_package
72
+ else
73
+ result = "#{context.package}.#{context.po_name}" if context.package
74
+ end
75
+ result
76
+ end
77
+
67
78
  def get_mapper_xml_path(workspace,context)
68
79
  mapper_path = workspace
69
80
  mapper_path << '/' unless mapper_path.end_with? '/'
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Mybatis
4
- VERSION = "0.0.7"
4
+ VERSION = "0.0.8"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mybatis-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - tong