我有 Spring Web 应用程序(JPA/Hibernate + MySQL)。我有两个 DAO 类。
客户DAO
@Entity
@Table(name = "customers")
public class Customer {
@Id
@Column(name = "customer_id")
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
@Column(name = "name", length = 50)
private String name;
@Column(name = "surname", length = 50)
private String surname;
@OneToMany(mappedBy = "customer")
private Set<Order> orders = new HashSet<>();
}
Run Code Online (Sandbox Code Playgroud)
订单DAO
@Entity
@Table(name = "orders")
public class Order {
@Id
@Column(name = "order_id")
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
@Column(name = "date")
private Date date; …Run Code Online (Sandbox Code Playgroud) 我有在 eclipse 中创建的工作 spring boot maven 项目。然后我将其导入 Intellij Ultimate,一切正常,单击运行并:
之后我有错误:
2017-02-15 12:46:58.459 ERROR 6020 --- [ restartedMain] o.s.boot.SpringApplication : Application startup failed
java.lang.IllegalStateException: Could not evaluate condition on org.springframework.boot.devtools.autoconfigure.DevToolsDataSourceAutoConfiguration due to javax/servlet/Filter not found. Make sure your own configuration does not rely on that class. This can also happen if you are @ComponentScanning a springframework package (e.g. if you put a @ComponentScan in the default package by mistake)
....
2017-02-15 12:46:58.478 ERROR 6020 --- [ restartedMain] o.s.b.f.s.DefaultListableBeanFactory : Destroy method …Run Code Online (Sandbox Code Playgroud) 我有一个结构对象,该对象具有一个来自外部库的字段,该字段定义为: pub struct SomeId(pub i64);
使用println!打印对象将显示此信息,例如:SomeId(123)
我创建了自己的结构:
#[derive(Debug)]
pub struct Something {
pub id: i64,
}
Run Code Online (Sandbox Code Playgroud)
而我试图把价值从外部结构SomeId到外地id在我的结构Something:
let test = Something { id: ?? };
Run Code Online (Sandbox Code Playgroud)
或者从struct中提取值SomeId:
let test: i64 = ??;
Run Code Online (Sandbox Code Playgroud)