gpt4 book ai didi

java - 错误 :The import com. google.appengine.api.datastore 无法解析 JPA GAE GWT

转载 作者:搜寻专家 更新时间:2023-10-31 20:21:13 26 4
gpt4 key购买 nike

开发模式错误

[ERROR] [cbd] - Line 15: The import com.google.appengine.api.datastore cannot be resolved

用户.java

@Entity
public class User implements Serializable {

private static final long serialVersionUID = 1L;

@Id
@Column(name="id")
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Key id;

private String googleID;

private String firstName;

private String lastName;

private String password;

private String gender;

private String email;


@OneToOne(cascade=CascadeType.ALL)
@JoinColumn(name="key")
private AuthenticationToken token= AuthenticationToken();
......}

AuthenticationToken.java

public class AuthenticationToken implements Serializable {

/**
*
*/
private static final long serialVersionUID = 1L;

@Id
@Column(name="key")
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Key key;

private String email;

private String token;

private Date obtained;

private Date activity;
.....}

持久性.xml

<?xml version="1.0" encoding="UTF-8" ?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0">

<persistence-unit name="transactions-optional">


<provider>org.datanucleus.api.jpa.PersistenceProviderImpl</provider>

<class>com.cbd.shared.entities.User</class>

<class>com.cbd.shared.entities.AuthenticationToken</class>

<exclude-unlisted-classes>true</exclude-unlisted-classes>

<properties>
<property name="datanucleus.NontransactionalRead" value="true"/>
<property name="datanucleus.NontransactionalWrite" value="true"/>
<property name="datanucleus.ConnectionURL" value="appengine"/>
</properties>
</persistence-unit>
</persistence>

我正在使用 GWT 尝试将实体移动到服务器端而不是共享端包但是同样的错误

最佳答案

发现错误 .was not adding DataNucleus Plugin to the eclipse 因此一些 JPA 库没有在 Project Runtime 中明确定义

关于java - 错误 :The import com. google.appengine.api.datastore 无法解析 JPA GAE GWT,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16533562/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com