[google-appengine] Enhancing Classes from an external Project
Hi all, I want to build a Web-App, which is strongly mpdular. This means the GUI and the Database Classes and Services are in their own Projects. So I got following: DataStore-Classes (jdo) and the Services to store data in the datastor are in a JavaProject, everything is ok. The GUI includes the Seervice interfaces and the GUI. So it works also fine. I´m including the project with the DataStorre-Classes and Services to the GWT/GAE-Project with the GUI. The GUI project compiles and everything seems ok. OK, now to the prolems I have: When I want to store something in the Database, I got Errors. The Error-Messages say, that the Database-Classes are not enhanced ... The problem is, as I can see, that the Datastore-Classes are not seen by the DataNucleus Enhancer. So they aren´t enhanced. I saw a article on the google-site, where a command line is added to the configuration, but this doesn´t work for me. I´m using EEclipse btw... MY question is now: How can I tell the DataNucleus Enhancer to enhance the classes in the external Project. (Reference or .jar) ?? Note: I also saw the Preferences at Google->App->Engine->ORM, but I can ´t add classes from pther projects, only from the own project? Somebody any idea, how I can solve this?? Thanks Greets Alex -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appeng...@googlegroups.com. To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
[google-appengine] Persistent class ... does not seem to have been enhanced .. Error??
Hi @ all, as you can see (topic) I get strange errors, when runnig my GWT/GAE projects. The error message is: Persistent class "myClass does not seem to have been enhanced. You may want to rerun the enhancer and check for errors in the output." has no table in the database, but the operation requires it. Please check the specification of the MetaData for this class. The thing is, to give more background information, I have 2 projects. One project includes the whole UI (gwt/gae), and the service interface. The other project (JavaProject) includes the service- implementation and the persistent-class-definitions. I believe, the problem is, that the datanucleus-enhance doesn´t know, where the persistent classes are. Don´t know if this is correct? Does anybody had a similar error? Any ideas how I can solve this problem? Thanks, Alex -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appeng...@googlegroups.com. To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
[google-appengine] Re: Enhancing Classes from an external Project
Problem is solved. On 26 Jul., 17:05, AlexG wrote: > Hi all, > > I want to build a Web-App, which is strongly mpdular. This means the > GUI and the Database Classes and Services > are in their own Projects. > > So I got following: > > DataStore-Classes (jdo) and the Services to store data in the datastor > are in a JavaProject, everything is ok. > The GUI includes the Seervice interfaces and the GUI. So it works also > fine. > I´m including the project with the DataStorre-Classes and Services to > the GWT/GAE-Project with the GUI. > > The GUI project compiles and everything seems ok. > > OK, now to the prolems I have: > > When I want to store something in the Database, I got Errors. The > Error-Messages say, that the Database-Classes are not enhanced ... > > The problem is, as I can see, that the Datastore-Classes are not seen > by the DataNucleus Enhancer. So they aren´t enhanced. > I saw a article on the google-site, where a command line is added to > the configuration, but this doesn´t work for me. I´m using EEclipse > btw... > > MY question is now: How can I tell the DataNucleus Enhancer to enhance > the classes in the external Project. > (Reference or .jar) ?? > > Note: I also saw the Preferences at Google->App->Engine->ORM, but I can > ´t add classes from pther projects, only from the own project? > > Somebody any idea, how I can solve this?? > > Thanks > Greets > Alex -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appeng...@googlegroups.com. To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
[google-appengine] Re: Error Doing RPC Call with my own return type: org.datanucleus.exceptions.ClassNotResolvedException
Hi spierce7 when I began working with Google AppEngine, I had the same problem. Well, you can´t return Objects, from persistet classes to the client. GWT can´t handle classe with @PErsistent annotations, especially the Key value. You need to define something like a DataTransferObject, of your persisted class. http://www.resmarksystems.com/code/ will help you, doing this, or you can code it manuell. I prefer code it manuell. The disadvantage of this technique is, that you have mor or less 2 classes for each persisted class, if you want to return it to the server, that means, if something changes, you have to changer both classes. Instead of doing this, you cam just return the int, String, double ... values you need on the client. Your DataTransfer Class fpr PersistrenceShift would look like this: public DataTransferShifr{ privte Date startDate; private Date endDate; } the methods are more or less the same. I hope this will help you. Greets Alex On 6 Aug., 19:48, spierce7 wrote: > Hey, so I can save data to app engine in an entity of type > "PersistentShift", a class I made to save shift information. I've got > 2 objects I'm saving within the class. Both are Date objects. One is > startDate, one is endDate. I wanted to be able to query the server, > and have a return type of PersistentShift. In order to do this it was > recommended that I put my Persistent shift class in the Shared > package, as opposed to having one in the client package, and one in > the server package. I've done this, and got it to where I can save > data again, but now I'm getting an error when I try to query that > data. Below is the relevant code. My code compiles with no errors: > === > = > package com.spierce7.gwt.scheduler.client; > public class Scheduler implements EntryPoint { > private final SchedulerServiceAsync schedulerService = > GWT.create(SchedulerService.class); > public boolean timerSet = false; > public void onModuleLoad() { > //Date startDate = new Date(); > //Date endDate = new Date(); > //endDate.setHours(endDate.getHours()+1); > //addShift(startDate, endDate); > loadShifts(); > } > private void loadShifts() { > schedulerService.getShifts(new > AsyncCallback>() { > public void onFailure(Throwable error) { > Window.alert(error.getMessage()); > } > public void onSuccess(List > results) { > Window.alert("Shift Retrieved > Successfully!"); > } > }); > } > > } > > == > package com.spierce7.gwt.scheduler.shared; > @PersistenceCapable(identityType = IdentityType.APPLICATION) > public final class PersistentShift implements IsSerializable { > @PrimaryKey > @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) > public Long id; > @Persistent > public Date startDate; > @Persistent > public Date endDate; > public PersistentShift() {} > public PersistentShift(Date startDate, Date endDate) { > this.startDate = startDate; > this.endDate = endDate; > } > > } > > === > package com.spierce7.gwt.scheduler.server; > public class SchedulerServiceImpl extends RemoteServiceServlet > implements SchedulerService { > private static final Logger LOG = > Logger.getLogger(SchedulerServiceImpl.class.getName()); > private static final PersistenceManagerFactory PMF = > JDOHelper.getPersistenceManagerFactory("transactions-optional"); > public void addShift(Date startDate, Date endDate) { > PersistenceManager pm = getPersistenceManager(); > try { > pm.makePersistent(new > PersistentShift(startDate, endDate)); > } finally { > pm.close(); > } > } > public List getShifts() { > PersistenceManager pm = getPersistenceManager(); > List results = new > ArrayList(); > try { > //Query query = > pm.newQuery(PersistentShift.class); > //query.setFilter(""); > //query.declareParameters("SchedulerDate > startDate SchedulerDate > endDate"); > //query.setOrdering("startDate"); > Query query = pm.newQuery("SELECT * FROM > PersistentShift"); > results = (List) > query.execute(); > } finally { > pm.close(); > } > retu
[google-appengine] Problem with query
Hi @ all, i have a problem with a query, What I want to do, is to search in a String[] for keywords. I use the String.startsWith("a") function. When I build the qery like this: select from ... where myArray.startsWith("keyword"), everything works fine. But the problem is, when I build a query, where I want to search for two keywords, the query doesnt give me results. Example: select from ... where myArray.startsWith(keyword1) && myArray.stratsWith("keyword2") I don´t know why this doenst work, maybe somebody can help me?? Thanks. Greets Alex -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appeng...@googlegroups.com. To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
[google-appengine] Re: Problem with query
Hi Robert, yes, if I have the same keywords, two times, I get results. It It seems, that your theory is right. Any suggestion, how I can realize this on one query? Greets Alex On 14 Okt., 18:33, Robert Kluin wrote: > Hey Alex, > I am guessing that under the hood App Engine breaks the startsWith > into two filters that looks something like: > myArray >= "keyword" AND myArray < "keyword" + "z" > > So when you add the second startsWith filter, you get: > myArray >= "keyword" AND myArray < "keyword" + "z" > AND myArray >= "otherword" AND myArray < "otherword2" + "z" > > That is not going to work. You may be able to validate my theory by > making the two keywords the same and seeing if you get results. > > Robert > > On Thu, Oct 14, 2010 at 03:17, AlexG > > wrote: > > Hi @ all, > > > i have a problem with a query, What I want to do, is to search in a > > String[] for keywords. > > I use the String.startsWith("a") function. > > > When I build the qery like this: > > > select from ... where myArray.startsWith("keyword"), everything works > > fine. > > > But the problem is, when I build a query, where I want to search for > > two keywords, the query > > doesnt give me results. > > > Example: > > > select from ... where myArray.startsWith(keyword1) && > > myArray.stratsWith("keyword2") > > > I don´t know why this doenst work, maybe somebody can help me?? > > > Thanks. > > > Greets > > Alex > > > -- > > You received this message because you are subscribed to the Google Groups > > "Google App Engine" group. > > To post to this group, send email to google-appeng...@googlegroups.com. > > To unsubscribe from this group, send email to > > google-appengine+unsubscr...@googlegroups.com. > > For more options, visit this group > > athttp://groups.google.com/group/google-appengine?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appeng...@googlegroups.com. To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
[google-appengine] ReqestFactory remove() not wirking for me
Hi @ all, I know, that theres an issue, and that this bug is already known. I always get errors, when I try to remove an Entity. I´m using JDO with the RequestFactory, and I get the following Error: Server Error: No such Object I checked the id and everything, but the Object definitely exists in my database. I don´t understand, why I get this Error? I mean persist() works as intended. The querys also works fine. Does someone know, what I´m doing wrong, or is it a bug? Greets Alex -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appeng...@googlegroups.com. To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
[google-appengine] Re: Problem with query
Hi Robert, thanks for your reply, thats a good ides, because my my keywords I´m searching for are indeed in a collection. So I´ll try it this way. Thanks. Greets Alex On 27 Okt., 19:11, Robert Kluin wrote: > Hi Alex, > You're really only going to be able to do a _prefix_ search using > one value at a time. However, if the string you are matching against > is some type of collection (list, array, set, etc...) of keywords you > can do multiple _equality_ matches. > > Robert > > On Wed, Oct 27, 2010 at 04:22, AlexG > wrote: > > Hi Robert, > > > yes, if I have the same keywords, two times, I get results. It It > > seems, > > that your theory is right. > > > Any suggestion, how I can realize this on one query? > > > Greets > > Alex > > > On 14 Okt., 18:33, Robert Kluin wrote: > >> Hey Alex, > >> I am guessing that under the hood App Engine breaks the startsWith > >> into two filters that looks something like: > >> myArray >= "keyword" AND myArray < "keyword" + "z" > > >> So when you add the second startsWith filter, you get: > >> myArray >= "keyword" AND myArray < "keyword" + "z" > >> AND myArray >= "otherword" AND myArray < "otherword2" + "z" > > >> That is not going to work. You may be able to validate my theory by > >> making the two keywords the same and seeing if you get results. > > >> Robert > > >> On Thu, Oct 14, 2010 at 03:17, AlexG > > >> wrote: > >> > Hi @ all, > > >> > i have a problem with a query, What I want to do, is to search in a > >> > String[] for keywords. > >> > I use the String.startsWith("a") function. > > >> > When I build the qery like this: > > >> > select from ... where myArray.startsWith("keyword"), everything works > >> > fine. > > >> > But the problem is, when I build a query, where I want to search for > >> > two keywords, the query > >> > doesnt give me results. > > >> > Example: > > >> > select from ... where myArray.startsWith(keyword1) && > >> > myArray.stratsWith("keyword2") > > >> > I don´t know why this doenst work, maybe somebody can help me?? > > >> > Thanks. > > >> > Greets > >> > Alex > > >> > -- > >> > You received this message because you are subscribed to the Google > >> > Groups "Google App Engine" group. > >> > To post to this group, send email to google-appeng...@googlegroups.com. > >> > To unsubscribe from this group, send email to > >> > google-appengine+unsubscr...@googlegroups.com. > >> > For more options, visit this group > >> > athttp://groups.google.com/group/google-appengine?hl=en. > > > -- > > You received this message because you are subscribed to the Google Groups > > "Google App Engine" group. > > To post to this group, send email to google-appeng...@googlegroups.com. > > To unsubscribe from this group, send email to > > google-appengine+unsubscr...@googlegroups.com. > > For more options, visit this group > > athttp://groups.google.com/group/google-appengine?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appeng...@googlegroups.com. To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
[google-appengine] RequestFactory EntityKeyId Base64
Hi @ all, I´m testing the RequestFactory with JDO. I got the insert und selects functions working. The update und delete functions doens´t work at the moment. I get the following Error, when I want to update or delete an Entity: Server Error: EntityKeyId was not Base64 encoded It seems that delete() calls the function findMyEntity(Long id). I don´t know why this Error is thrown. Or how can I make it work? Anyone can help me?? Thanks Greets Alex -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appeng...@googlegroups.com. To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.