Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type aliases are not correctly detected when package is specified in the config #42

Closed
harawata opened this issue Apr 3, 2016 · 8 comments
Assignees
Labels
Milestone

Comments

@harawata
Copy link
Member

harawata commented Apr 3, 2016

With config like below, MyBatipse only detects the direct children of the specified packages.

<!-- mybatis config -->
<typeAliases>
  <package name="pkg1" />
</typeAliases>
<!-- spring config -->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
  <property name="typeAliasesPackage" value="pkg1"/>
  ...
</bean>

Reported by @akacd in this comment

@harawata
Copy link
Member Author

harawata commented Apr 3, 2016

@akacd
Please let me know if your problem is not resolved with 1.0.16.
Thank you again!

@akacd
Copy link

akacd commented Apr 3, 2016

@harawata
I tried with 1.0.16 in several ways,but it seems there are still errors like this "Class/TypeAlias 'Article' not found."

original code:
<property name="typeAliasesPackage" value="com.thinkgem.jeesite"/>

then I add all the packages,then validate the resources/mapping dir,there are still errors -->
<property name="typeAliasesPackage" value="com.thinkgem.jeesite.modules.act.entity,com.thinkgem.jeesite.modules.cms.entity,com.thinkgem.jeesite.modules.gen.entity,com.thinkgem.jeesite.modules.oa.entity,com.thinkgem.jeesite.modules.sys.entity,com.thinkgem.jeesite.modules.test.entity"/>

then I add a single package and validate the mapping dir for testing, but again errors.
<property name="typeAliasesPackage" value="com.thinkgem.jeesite.modules.cms.entity"/>
the entities' dirs are like this:
image

@akacd
Copy link

akacd commented Apr 3, 2016

@harawata
And I just uninstall the mybatipse.Leaving only the
<property name="typeAliasesPackage" value="com.thinkgem.jeesite.modules.cms.entity"/>
then validate all the resources/mapping dirs ,no errors at all.
Of course it shows errors in console when I tried to start the project.

I don't know if my configurations are wrong?I'm using
Spring Tool Suite
Version: 3.7.3.RELEASE
Build Id: 201602250940
Platform: Eclipse Mars.2 (4.5.2)

@akacd
Copy link

akacd commented Apr 3, 2016

I also tried the project:
https://github.com/mybatis/jpetstore-6
The same errors : "Class/TypeAlias 'Account' not found.".
The configuration is below ,the project has all the entities in the package: org.mybatis.jpetstore.domain
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"> <property name="dataSource" ref="dataSource" /> <property name="typeAliasesPackage" value="org.mybatis.jpetstore.domain" /> </bean>

@harawata
Copy link
Member Author

harawata commented Apr 3, 2016

There seems to be some incompatibility with Spring Tool Suite.
Sunday is over, so please give me a few days to fix it.
Thank you for the helpful information and sorry for the inconvenience!

@DoneSpeak
Copy link

DoneSpeak commented Dec 4, 2018

Have this bug been fixed? It happens again.

Mybatipse: 1.2.1
Eclipse: Neon.3 Release (4.6.3)
Spring: 4.1.3.RELEASE
Maven: 3.5.0

@harawata
Copy link
Member Author

harawata commented Dec 5, 2018

@DoneSpeak ,

Have you read the doc ?
If it didn't resolve the problem, please create a new issue with the details about your project, notably how you configure type aliases.

@DoneSpeak
Copy link

@harawata ,
Oh, I'm sorry. I will read the doc again more carefully and try it again.
Thanks, sincerely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants