My entity class :

public class ACCOUNT implements Serializable{
 private static final long serialVersionUID = 1L;

@Id
@Column(name = "USERNAME")
private String Username;
 @Column(name = "PASSWORD")
private String Password;
 public ACCOUNT(String user,String pass)
{
this.Username=user;
this.Password=pass;
}

    // geter and setter

my persistence.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.materialshop.server.Datastore.ACCOUNT</class>
        <exclude-unlisted-classes/>
        <properties>
            <property name="datanucleus.NontransactionalRead" value="true"/>
            <property name="datanucleus.NontransactionalWrite" 
value="true"/>
            <property name="datanucleus.nontx.atomic" value="true"/>
            <property name="datanucleus.ConnectionURL" value="appengine"/>
        </properties>
    </persistence-unit>
</persistence>

Now persist account and it was successful

ACCOUNT ac=new ACCOUNT("admin","123");
em.persist(ac);

I checked http://localhost:8888/_ah/admin and yes ,there is ACOUNT entity 
with 1 record admin and 123

but when I use JPQL to get all entity , it returned null

Query q=new Query("SELECT ac FROM ACCOUNT ac");
List<ACCOUNT> list=q.getResultList();

even with 

em.find(ACCOUNT.class,"admin"); return null too 

Did i miss something ? Please help me , very grateful for your help

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine/-/_EC0SHCHncYJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to