Hi,

There are several entities which have 1:n relationship in our SaaS
application. For the sake of simplicity and keeping the domain simple,
I tried the same concept with a small application but still found that
the configuration file formed with the BulkLoader did not respect
relationships.

For example,
I have 2 entities User and UserDepartment. They are related to each
other with a n:1 relationship.

@Entity
public class User extends DomainObject<Long, User> {
...
@ManyToOne(fetch = FetchType.EAGER)
        private UserDepartment userDepartment;
...
}

and

@Entity
public class UserDepartment extends DomainObject<Long, UserDepartment>
{
...
@OneToMany(mappedBy = "userDepartment", cascade = CascadeType.ALL,
fetch=FetchType.EAGER)
        private Set<User> users = new HashSet<User>();
...
}

Now when I try to create a configuration file for my application with
a command like this

bulkloader.py --create_config --url=http://appname.appspot.com/
remote_api --application=appid --filename=generated_bulkloader.yaml

I see the following results in the generated_bulkloader.yaml

- kind: UserDepartment
  connector: csv
  connector_options:
    encoding: utf-8
    columns: from_header
  property_map:
    - property: __key__
      external_name: key
      export_transform: transform.key_id_or_name_as_string

    - property: name
      external_name: name
      # Type: String Stats: 16 properties of this type in this kind.


and

- kind: User
  connector: csv
  connector_options:
    encoding: utf-8
    columns: from_header
  property_map:
    - property: __key__
      external_name: key
      export_transform: transform.key_id_or_name_as_string

    - property: email
      external_name: email
      # Type: String Stats: 17 properties of this type in this kind.

    - property: firstName
      external_name: firstName
      # Type: String Stats: 17 properties of this type in this kind.

    - property: lastName
      external_name: lastName
      # Type: String Stats: 17 properties of this type in this kind.

    - property: password
      external_name: password
      # Type: String Stats: 17 properties of this type in this kind.

    - property: salt
      external_name: salt
      # Type: Integer Stats: 17 properties of this type in this kind.
      import_transform: transform.none_if_empty(int)

Hence there is no mention of either entity in either kind. Am I
missing something? Is there something that i can add to the generated
yaml file to fetch the relationships.

Regards | Vikas
www.inphina.com

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" 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-appengine-java?hl=en.

Reply via email to