我正在学习Spring,事情进展顺利,但突然遇到这个无法找到合格bean的问题.撞墙,即使在新的应用程序中,我也得到了这个.
如果您需要更多,请告诉我,休息一下!我必须错过一些非常简单的事情.
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException:
No qualifying bean of type [com.alco.repository.ContactRepository]
found for dependency [com.alco.repository.ContactRepository]:
expected at least 1 bean which qualifies as autowire candidate for this dependency.
Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
Run Code Online (Sandbox Code Playgroud)
我的依赖:
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-rest</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-hateoas</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Run Code Online (Sandbox Code Playgroud)
联系班级:
package com.example.entity;
import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import …Run Code Online (Sandbox Code Playgroud) 我正在上课,回顾各种语言,我们正在用Lisp构建一个文本解析器.我可以让我的Lisp程序用数字做很多不同的函数,但我正在努力处理文本.我想偷看一行中的第一个字符,看它是否包含<然后做某事,但我似乎无法弄清楚如何去完成这个简单的任务.到目前为止,这是我简单的小代码:
;;;Sets up the y.xml file for use
(setq file (open "c:\\temp\\y.xml"))
;;;Just reads one line at a time, (jkk file)
(defun jkk (x)
(read-line x)
)
;;;Reads the entire file printing each line, (loopfile file)
(defun loopfile (x)
(loop for line = (read-line x nil)
while line do (print line))
)
Run Code Online (Sandbox Code Playgroud)
下一部分我试图将循环与if语句结合起来,看看它是否可以找到"<",如果是这样,只需打印该行并跳过任何其他不起作用的行.任何帮助做这个非常简单的任务将不胜感激.之前从未使用过Lisp或任何其他函数式语言,我习惯在VB和Java项目中使用疯狂的函数,但我没有任何体面的Lisp参考资料.
完成此程序后,我们不再需要使用Lisp了,所以我没有费心去订购任何东西.尝试使用Google Books ..开始计算出来的东西,但这种语言又古老而又艰难!
;;;Reads the entire file printing the line when < is found
(defun loopfile_xml (x)
(loop for line = (read-line x nil)
while line do …Run Code Online (Sandbox Code Playgroud) 我想在删除的记录上设置日期/时间戳,但我得到了奇怪的结果.当此触发器触发时,它将日期设置为1906!
我已尝试GETDATE()在查询中使用该函数,UPDATE并在表属性上使用默认值.它适用于我手动输入到DELETED_RECORDS表中的记录,但由于实际删除而移入的任何记录都有1906日期.我不确定发生了什么
ALTER TRIGGER [dbo].[Backup_TT_Deleted_Records]
ON [dbo].[tblLLS_TT]
FOR DELETE
AS
BEGIN
INSERT INTO dbo.tblLLS_TT_DELETED_RECORDS
SELECT *
FROM Deleted
UPDATE dbo.tblLLS_TT_DELETED_RECORDS
SET Deleted_DTTM = GETDATE()
WHERE dbo.tblLLS_TT_DELETED_RECORDS.Deleted_DTTM IS NULL
END
Run Code Online (Sandbox Code Playgroud)
还有上面的触发器,如果我在DELETED_RECORDS表上输入一个记录而留下Delete_DTTMnull然后删除一个记录,导致触发器触发它将正确填写该记录,但是进入DELETED_RECORDS表中的记录将再次具有日期我还注意到每条记录的日期增加一天.
知道这里可能会发生什么吗?
您希望我执行的任何其他测试让我知道,我会发布结果.这个很奇怪.谢谢!