我有"web"模块的项目.在模块中,我使用frontend-maven-plugin的"pom.xml":
<build>
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>0.0.26</version>
<executions>
<execution>
<id>bower install</id>
<goals>
<goal>bower</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<arguments>install</arguments>
<installDirectory></installDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
Run Code Online (Sandbox Code Playgroud)
在web模块中还有.bowerrc文件:
{
"directory":"src/main/resources/static/bower_components"
}
Run Code Online (Sandbox Code Playgroud)
和bower.json文件:
{
"name": "web",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"dependencies": {
"jquery": "~2.1.4",
"bootstrap": "~3.3.5"
}
}
Run Code Online (Sandbox Code Playgroud)
也是package.json文件:
{
"name": "web",
"devDependencies": {
"bower": "~1.6.5"
},
"engines": {
"node": ">=0.10.40"
}
}
Run Code Online (Sandbox Code Playgroud)
当我尝试"mvn clean install"时出现错误:
[INFO] Running 'bower install' in /home/aleksandar/projects/cs230/web
[ERROR] module.js:338
[ERROR] throw err;
[ERROR] ^
[ERROR] …Run Code Online (Sandbox Code Playgroud) 当我尝试为数据库播种时,Laravel会抛出此错误.
我的表是INSTIT_school而不是institution_schools,Laravel在错误中报告了什么.
[Illuminate\Database\QueryException]
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'eesdatabase.inst
itution_schools' doesn't exist (SQL: insert into `institution_schools` (`sc
hool_id`, `instituion_id`, `energy_id`, `year`, `updated_at`, `created_at`)
values (38, 1, 1, 2005, 2014-07-04 19:38:41, 2014-07-04 19:38:41))
Run Code Online (Sandbox Code Playgroud)
我尝试删除数据库,然后再次迁移和播种.我尝试用"php artisan:cache clear"重置Laravel缓存
有谁知道如何解决这一问题?谢谢
<?php
class InstitutionSchool extends Eloquent {
protected $table = "institution_school";
protected $guarded = array('id');
public function school() {
return $this -> belongsTo('School');
}
public function institutio() {
return $this -> belongsTo('Institution');
}
public function energy() {
return $this -> belongsTo('Energy'); …Run Code Online (Sandbox Code Playgroud) 我可以禁用 spring MVC为复选框生成隐藏字段吗?我正在使用 Thymeleaf 模板。
谢谢!
我正在使用 SpringBoot、Spring 数据和 postgresql。
在 postgres 中,我创建了一张表。
CREATE EXTENSION "uuid-ossp";
CREATE TABLE user (
id serial PRIMARY KEY not null,
user_id varchar(255) not null default uuid_generate_v4()
);
Run Code Online (Sandbox Code Playgroud)
比创建实体
@Entity
public class User implements Serializable {
private static final long serialVersionUID = 9129894781337596497L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(columnDefinition = "serial")
private Integer id;
@Column(insertable = false)
private String userId;
public static User create(){
User user = new User();
return user;
}
public String getUserId(){
return userId;
}
}
Run Code Online (Sandbox Code Playgroud)
比这样创建 jpa 存储库 …