I have a class I am successfully able to persist to the datastore:

package com.appointments;

import java.util.Date;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;

@PersistenceCapable
public class Client {

        @PrimaryKey
        @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
        private Key key;

        @Persistent
    private int clientId;

        @Persistent
    private String clientName;

    @Persistent
    private Date dateAdded;

    @Persistent
    private Customer[] customers;

    @Persistent
    private Resource[] resources;

    public Key getKey() {
                return key;
        }

        public void setKey(Key key) {
                this.key = key;
        }

        public String getClientName() {
                return clientName;
        }

        public void setClientName(String clientName) {
                this.clientName = clientName;
        }

        public Date getDateAdded() {
                return dateAdded;
        }

        public void setDateAdded(Date dateAdded) {
                this.dateAdded = dateAdded;
        }

        public Customer[] getCustomers() {
                return customers;
        }

        public void setCustomers(Customer[] customers) {
                this.customers = customers;
        }

        public Resource[] getResources() {
                return resources;
        }

        public void setResources(Resource[] resources) {
                this.resources = resources;
        }

        public void setClientId(int clientId) {
                this.clientId = clientId;
        }

        public int getClientId() {
                return clientId;
        }

}


And I can delete it from the datastore viewer, but when I try to
delete it via RPC call I get:

SEVERE: [1278546531467000] javax.servlet.ServletContext log: Exception
while dispatching incoming RPC call
com.google.gwt.user.server.rpc.UnexpectedException: Service method
'public abstract void
com.appointments.clientactions.client.ClientService.deleteClient(com.appointments.client.dto.client.ClientDTO)'
threw an unexpected exception:
java.lang.UnsupportedOperationException: FK Arrays not supported.

My delete method looks like this:

public void deleteClient(ClientDTO pClientDTO) {
                System.out.println("ClientServiceImpl::deleteClient called with 
key
" + pClientDTO.getKey());
                PersistenceManager pm = PMF.get().getPersistenceManager();

                Key k = KeyFactory.stringToKey(pClientDTO.getKey());

                Client lClient = 
pm.getObjectById(com.appointments.Client.class, k);
                if (lClient != null) {
                        System.out.println("Trying to delete " + 
lClient.getClientName());
                        pm.deletePersistent(lClient);
                }
                pm.close();
        }

Thanks for any help!

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
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-web-toolkit?hl=en.

Reply via email to