Hi all, in the advance tutorial description of the BasicType states: "BasicType is typically used for fundamental types, for example different quantities such as Money, or range of values."
So, the emphasis was on "is typically used for fundamental types," which implies that i can use references to, lets say Entities in the BasicType if i would like to. Or not? I took library example and modiefed Country to be Entity and not Enum. So all of my Countries are stored in Database and when a new Country popup i do not need to modify code, compile, distribute, etc. just need to insert new record in database. So my Person module after this change looks like this: Module person { Service PersonService { findPersonByName => PersonRepository.findPersonByName; } Entity Person { gap scaffold Date birthDate past - @Gender sex !changeable - @Ssn ssn key - @PersonName name Repository PersonRepository { List<@Person> findPersonByName(String name) => AccessObject; save; save(Collection<@Person> entities); findByQuery; findByExample; findByKeys; } } BasicType Ssn { String number key length="20" - @Country country key } BasicType PersonName { String first String last } enum Gender { FEMALE("F"), MALE("M") } Entity Country { scaffold String code key String name int numeric Repository CountryRepository { @Country findCountryByCode(String code) throws CountryNotFoundException => findByKey; findById; findAll; save; delete; countAll; } } } } However, when i generate sources now, in the the Ssn java class I see following definition for the Country object: @Transient @NotNull private Country country; So, it is declared as Tranisent field! When i looked at the generated PersonBase java class i found another surprise, definition of the embeded object Ssn was as follows: @Embedded @AttributeOverrides({...@attributeoverride(name = "number",column = @Column(name = "SSN_NUMBER",nullable = true,length = 20) ) , }) @NotNull private Ssn ssn; So, no reference to country at all? But, Person java class stated following (i first deleted old class so the new one was generated to reflect changes in the model): @Entity @Table(name = "PERSON", uniqueConstraints = @UniqueConstraint(columnNames = { "SSN_NUMBER", "SSN_COUNTRY"} ) ) public class Person extends PersonBase { private static final long serialVersionUID = 1L; protected Person() { } public Person(Gender sex, Ssn ssn) { super(sex, ssn); } } However, field with name SSN_COUNTRY is nowhere defined? No Hibernate annotation references this field. Then, i modifed sculptor-generator.properties and declared db.product=mysql to see what would be the definition of the table. And as I expected the PERSON table does not contain any field which would store reference to COUNTRY table, and no FOREIGN KEY definition exists anywhere. Although, funnily, invalid unique constraint is created! CREATE TABLE PERSON ( ID BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, BIRTHDATE DATE NOT NULL, CREATEDDATE TIMESTAMP, CREATEDBY VARCHAR(50), LASTUPDATED TIMESTAMP, LASTUPDATEDBY VARCHAR(50), VERSION BIGINT NOT NULL, SSN_NUMBER VARCHAR(20) NOT NULL, NAME_FIRST VARCHAR(100) NOT NULL, NAME_LAST VARCHAR(100) NOT NULL, SEX VARCHAR(100) NOT NULL, CONSTRAINT UNIQUE (SSN_NUMBER, SSN_COUNTRY) ); So, as far as i can see, it seems that references to the Entities can not be used in the BasicTypes, is this correct or not? Huh, i hope i have been clear enough. best Domagoj No mention of reference to COUNTRY? -- View this message in context: http://old.nabble.com/BasicType-with-reference-to-Entity-tp26866241s17564p26866241.html Sent from the Fornax-Platform mailing list archive at Nabble.com. ------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev _______________________________________________ Fornax-developer mailing list Fornax-developer@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/fornax-developer