java - Can't save current user as object in User Pointer column (Parse4J) -
i'm trying save currentuser pointer<_user> column in 1 of classes. library-specific problem (https://github.com/thiagolocatelli/parse4j/blob/master/src/main/java/org/parse4j/parseuser.java). i'm wondering if else has had similar issue.
parseuser currentuser = parseuser.currentuser; parseobject sentrequest = new parseobject(parseconstantsutil.class_request); sentrequest.put("author", currentuser); try { sentrequest.save(); } catch (org.parse4j.parseexception e) { e.printstacktrace(); }
pom.xml: i'm using latest snapshot build parse4j dependency.
<dependency> <groupid>com.github.thiagolocatelli</groupid> <artifactid>parse4j</artifactid> <version>1.5-snapshot</version> </dependency>
exception:
parseexception [code=111, error=schema mismatch request.author; expected pointer<_user> got pointer<users>] @ org.parse4j.command.parseresponse.getparseerror(parseresponse.java:122) @ org.parse4j.command.parseresponse.getexception(parseresponse.java:78) @ org.parse4j.parseobject.save(parseobject.java:486) @ com.test.automation.controller.requestcontroller.createrequestobject(requestcontroller.java:119) @ com.test.automation.controller.requestcontroller.saverequest(requestcontroller.java:89) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:62) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) @ java.lang.reflect.method.invoke(method.java:498)
what's going wrong here?
it works when query current user, think that's unnecessary additional call. i'd love know why first attempt fails...
parsequery<parseobject> userquery = parsequery.getquery("_user"); userquery.whereequalto("objectid", currentuser.getobjectid()); try { list<parseobject> userlist = userquery.find(); (parseobject author : userlist) { sentrequest.put("author", author); try { sentrequest.save(); } catch (org.parse4j.parseexception e) { e.printstacktrace(); } } } catch (org.parse4j.parseexception e) { e.printstacktrace(); }
Comments
Post a Comment