Hallo,
I have some problems with maps.
the classes:
-----------------------------------------
public class Company {
@Id
Long id;
String name;
@OneToMany( cascade=CascadeType.ALL )
@JoinColumn(name="company_id")
@MapKey(name="key")
Map String,Contact contacts
}
public class Contact {
@Id
Long id;
String name;
String key;
@ManyToOne
Company company;
}
The Code:
----------------------------------
Company company = new Company();
company.setName( "CompanyName1" );
Contact contact = new Contact();
contact.setName( "ContactName1" );
company.contacts.put( "key1", contact )
contact.setCompany( company );
Ebean.save( company )
The first problem:
This seems me not ok in AnnotationAssocManys.java(line 92)
MapKey mapKey = (MapKey) get(prop, MapKey.class);
if (mapKey != null) {
prop.setFetchOrderBy(orderBy.value()); ----
}
i fixed this to
prop.setMapKey(mapKey.name());
but after this is it also not possible
to save a map.
Manfred