سؤال

I'm having a really odd issue and maybe one of you can shed some light on it. I would appreciate it :)

I'm developing an application using Objectify 1.1rc module for Play! Framework 1.1. I have 2 related objects whose relevant parts are:

public class User extends ObjectifyModel<User> {
  [...]
    public List<Key<Theatre>> theatres;
  [...]    
}

public class Theatre extends ObjectifyModel<Theatre> {
  [...]
}

Some background:

  • I'm using Objectify 1.1rc from the Google code repository (the module in Play repository seems to fail with Play! 1.1) The sample application works fine
  • I based the objects in existing objects working properly on the sample application provided with the Objectify-1.1rc module for Play Framework (Showcase).
  • I did debugging and testing by pointing my application and the sample application (Showcase) to the same CRUD module.
  • I can link them using Java code without any problem.

Presently I have 2 issues that I cannot solve, which are:

M:1 relation not being saved

I have an issue with the 'theatres' relation from the User class. When editing an object of type User via CRUD, I can see the multi-select control to relate Theatre instances to the User, When I click on some (one or more) of them and save the object, the relation is not saved, making it impossible to link the objects via the CRUD interface.

How can make it work?

CRUD code not being accessed by one application but accessed by the other

The sample application from Objectify module (Showcase) allows me to save M:1 relations using CRUD. As I mentioned before, both my application and showcase point to the same CRUD module, so they should use exactly the same code. What I noticed, by debugging via Log outputs, is that my application uses CRUD, but the sample application uses all the code up to a certain point.

The CRUD module traverses to 'tag/form.html', finds a field of type 'relation' (in both my code and the sample application) but when calling the tag '#{crud.relationField}' something odd happens: my application goes into the tag defined in the CRUD module. The sample application doesn't access that code, no logs added to that tag are triggered (at any point of the file).

I've searched for any replacement of the tag in the sample application, but I'm unable to find one. As you can guess, it's driving em crazy and making me start believing in green leprechauns living in my desktop (without giving me the gold, damn them!)

Anyone knows why does this happen? And were can I find the code being executed by the sample application? Finding it would most likely solve the issue #1

Thanks a lot!

هل كانت مفيدة؟

المحلول

Ok, found the issue to #1. I had a method called "getTheatres()" (should have had another name, was an error) and that was breaking the CRUD. Renaming the method solve issue #1.

I still didn't find why #2 was happening, but I believe I'll leave as one of those "worked in my computer" issues so common in our world...

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top