2013年9月17日星期二

packagesToScan problem

Hello, have a question to ask you , where the first thank you !
Description: I am using spring3.0.5, in the configuration packagesToScan when some problem. I have several model, respectively, in different package under . Previously, only one package, the following configuration packagesToScan only one list, it is possible. When you configure two packets, it is not being given to start the service , but the use of the time , another package entity does not automatically generate data sheet. When the configuration file is not generated just before the configuration data table that package , start on the error , because in this package , by using ManyToOne to another package ( not configured to packagesToScan), and this package is not configured to packagesToScan so being given . I've used the following methods:

<property name="packagesToScan">
<list>/不报错,但是第二个包下面的类没有自动创建数据表
<value>com.text.common.model</value>                             <value>com.text.system.model</value>
</list>
</property>



<property name="packagesToScan">
<list>
<!-- <value>com.text.common.model</value> -->//报错了,因为第二个包下在的实体使用到第一个包下面的了,而第一个包没有配置。
<value>com.text.system.model</value>
</list>
</property>



<property name="packagesToScan">
<list>
<value>com.text.common.model</value>                            <!--<value>com.text.system.model</value>-->//使用的时候报错,因为第二个包没有配置。
</list>
</property>


com.text. * / / does not work
com.text. *. model / / or not
also used this :

question : packagesToScan how to monitor multiple packets following model?

------ Solution ------------------------------------ --------
to be honest , I did not how tested, but now I project this configuration :

No problem
------ Solution ---------------------------------- ----------
Why not put all of the model are placed in a bag below ? See programming specification.
------ Solution ---------------------------------------- ----
you just write * had
------ For reference only ------------------------- --------------
top up, trouble you . Thank you !
------ For reference only -------------------------------------- -

configure only one value of this is possible, but if you configure more than one value, how to configure .
Also, not all of the model are placed in a package below , will certainly be sub- model classification . And everyone is how to solve this issue?
------ For reference only -------------------------------------- -
If the model is not all in one package , this situation how to solve it ?
------ For reference only -------------------------------------- -
Thank you , the fact that different packages , the use of this approach is possible :
com.text.common.model ; com.text.system.model

problem has been resolved .
then flash Thank you !
------ For reference only -------------------------------------- -
landlord you how to solve
------ For reference only -------------------------- -------------


com.text.common.model ;
com.text.system.model ;


I think you are very correct with the problem should not arise in the configuration .

没有评论:

发表评论