前言:今天做了简单的增删改,遇到诸多问题,非常感谢婉萍姐和陈哥还有敏君学长的帮助,学习到一些
出现问题一:
错误描述:在HelloworldApiImpl这个类里参数是有值不为null,出现异常信息:java.lang.reflect.UndeclaredThrowableException, 实体类的字段名称与数据库的是否相同
问题分析:检查实体类@Column(name = "xxx ")是否与数据库字段对应
解决方案:发现都对应上了,思考后发现
原来在实体类的父类BaseEntity<Integer>里已经封装了
ID,所以去掉
,问题解决
出现问题二:
错误描述:不能识别实体类HelloworldEntity
问题分析:检查是否正确的导入包,发现导包正确。检查dao里
BaseDao的泛型是否正确,发现正确。检查实体类里发现问题原因
解决方案:
发现实体类头上的@Table注释了,解开注释,问题解决
出现问题三:
错误描述:在tomcat下不能找到jar,也就是无法更新maven,update project…失败,
An internal error occurred during: "Updating Maven Project".
org/apache/maven/project/MavenProject
问题分析:D:\maven\apache-maven-3.2.2\conf检查settings.xml,查看是否配置错误。
settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<server>
<id>tansun-profile</id>
<username>admin</username>
<password>admin123</password>
</server>
<server>
<id>nexus-releases</id>
<username>deployment</username>
<password>deployment123</password>
</server>
<server>
<id>nexus-snapshots</id>
<username>deployment</username>
<password>deployment123</password>
</server>
<server>
<id>tomcat</id>
<username>tomcat</username>
<password>tomcat</password>
</server>
</servers>
<mirror>
<id>nexus-mirror</id>
<name>nexus-mirror</name>
<url>http://183.250.161.187:8081/nexus/content/groups/public/</url>
<!--<url>http://172.19.0.131:8081/nexus/content/groups/public/</url>-->
<mirrorOf>*</mirrorOf>
</mirror>
<!-- 阿里私服 -->
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
<profile>
<id>nexus-profile</id>
<repositories>
<repository>
<!--tansun Nexus仓库-->
<id>nexus-repository</id>
<!--<url>http://nexus-mirror</url> -->
<url>http://183.250.161.187:8081/nexus/content/groups/public/</url>
<!--<url>http://172.19.0.131:8081/nexus/content/groups/public/</url>-->
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled><updatePolicy>always</updatePolicy></snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>nexus-plugin-repository</id>
<url>http://183.250.161.187:8081/nexus/content/groups/public/</url>
<!--<url>http://172.19.0.131:8081/nexus/content/groups/public/</url>-->
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled><updatePolicy>always</updatePolicy></snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
<profile>
<id>jdk16</id>
<activation>
<activeByDefault>true</activeByDefault>
<jdk>1.6</jdk>
</activation>
<properties>
<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>
<maven.compiler.compilerVersion>1.6</maven.compiler.compilerVersion>
</properties>
</profile>
<activeProfiles>
<activeProfile>nexus-profile</activeProfile>
</activeProfiles>
<localRepository>
D:\maven\RepMaven
</localRepository>
</settings>
并没有发现错误。进入tomcat下,查看发现项目内容更改成功,进行百度问题,maven无法update更新成功解决方法。
解决方案:
1、右键点击我的项目,选择 Maven -> Remove(disable) Maven Nature.
2、打开cmd命令行,进入到你的工程文件夹中,并且 运行 “mvn eclipse:clean”
3、右键点击你的工程,并且选择 “Configure -> Convert into Maven Project”
4、在项目文件夹中运行mvn eclipse:eclipse
重新刷新不行,再重新导入项目即可
发现并没有用,它会变成不是maven项目,也就是eclipse无法识别成maven项目,思考,如何才能让它恢复,删掉在eclipse里的maven项目,从工作空间重新导入,让它重新下载包,再clean install进行安装。成功,得到更新
学习到的内容:
1.今天做了增删改的简单功能,知道了公司封装的进行查单笔的方法有findone(),保存方法save(),修改方法update(),删除是进行逻辑删除修改字段DEL_IND,在查询的时候在mapper映射文件sql语言进行sql代码块的判断,
2.
公司成功或者失败返回的信息可以用jfLayer来调用alert,fail,
3.在调用公司封装好的id时,(sql要进行查询,但是实体类可以没有这个id属性,公司已经封装好了),可以使用
$stateParams来使用,进行跳转的时候,也可进行传值,
然后记得配置: