Project

General

Profile

Anomalie #1232

Template TemplateAdapterBase.java relation @OneToMany error

Added by Mickael G. almost 7 years ago. Updated almost 7 years ago.

Status:
Fermé
Priority:
Urgent
Assignee:
Gregg C.
Category:
-
Target version:
Start date:
12/15/2012
Due date:
% Done:

100%

Estimated time:
0.30 h

Description

Le model :

    /** Account use for connect and store history */
    @Table()
    //@Rest()
    @Entity()
    public class Account  implements Serializable{
        // Technical
        @Id()
        @GeneratedValue()
        @Column()
        protected int id;

        // Civility
        /** Title (Mr, ...) */
        @Column(type=Type.INT)
        protected Title title;

        /** First name */
        @Column()
        protected String firstName;

        /** Last name */
        @Column()
        protected String lastName;

        /** Date of Birth */
        @Column(name="date_birth")
        protected DateTime dateOfBirth;

        // Account
        /** Email address */
        @Column()    // type=Type.EMAIL
        protected String email;

        /** Password account */
        @Column(type=Type.PASSWORD)
        protected String passwd;

        // Newsletter
        /** enable newsletter inscription */
        @Column(name="news")
        protected boolean newsletter;

        /** enable newsletter partner inscription */
        @Column(name="news_part")
        protected boolean newsletterPartner;

        /** enbale newsletter private inscription */
        @Column(name="news_priv")
        protected boolean newsletterPrivate;

        // Address
        /** Address principal */
        @OneToOne
        protected Address addressPrincipal;

        /** Address delivery */
        @OneToOne
        protected Address addressDelivery;

        /** List of Purchases */
        @OneToMany
        protected ArrayList<Purchase> purchases;

        /** List of Favories */
        @OneToMany
        protected ArrayList<Favorite> wishlist;

        /** Civility Title */
        public enum Title {
            MR(1),
            MRS(2);
            private int value;

            private Title(int value){
                this.value = value;
            }

            public int getValue(){
                return this.value;
            }

            public static Title fromString(int value){
                for (Title type : Title.values()) {
                    if (value == type.value) {
                        return type;
                    }    
                }
                return null;
            }
        }
    }

génère :

    // CRUD Entity
    /** Find & read Account by id in database
     * 
     * param id Identify of Account
     * return Account entity
     */
    public Account getByID(int id) {
        Cursor c = this.getSingleCursor(id);
        if(c.getCount()!=0)
            c.moveToFirst();
        Account result = AccountAdapterBase.cursorToAccount(c);
        c.close();
        PurchaseAdapter purchaseAdapter = new PurchaseAdapter(this.context);
        purchaseAdapter.open(this.mDatabase);
        result.setPurchases(purchaseAdapter.getBy
Expression relation.relation.inversedBy is undefined on line 280, column 113 in tpl/android/src/provider/TemplateAdapterBase.java.
The problematic instruction:
----------
==> ${relation.relation.inversedBy?cap_first} [on line 280, column 111 in tpl/android/src/provider/TemplateAdapterBase.java]
----------
Java backtrace for programmers:
----------
freemarker.core.InvalidReferenceException: Expression relation.relation.inversedBy is undefined on line 280, column 113 in tpl/android/src/provider/TemplateAdapterBase.java.
    at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:125)
    at freemarker.core.Expression.getStringValue(Expression.java:118)
    at freemarker.core.Expression.getStringValue(Expression.java:93)
    at freemarker.core.StringBuiltins$StringBuiltIn._getAsTemplateModel(StringBuiltins.java:71)
    at freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
    at freemarker.core.Expression.getStringValue(Expression.java:93)
    at freemarker.core.DollarVariable.accept(DollarVariable.java:76)
    at freemarker.core.Environment.visit(Environment.java:221)
    at freemarker.core.MixedContent.accept(MixedContent.java:92)
    at freemarker.core.Environment.visit(Environment.java:221)
    at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:79)
    at freemarker.core.Environment.visit(Environment.java:221)
    at freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:179)
    at freemarker.core.Environment.visit(Environment.java:428)
    at freemarker.core.IteratorBlock.accept(IteratorBlock.java:102)
    at freemarker.core.Environment.visit(Environment.java:221)
    at freemarker.core.MixedContent.accept(MixedContent.java:92)
    at freemarker.core.Environment.visit(Environment.java:221)
    at freemarker.core.IfBlock.accept(IfBlock.java:82)
    at freemarker.core.Environment.visit(Environment.java:221)
    at freemarker.core.MixedContent.accept(MixedContent.java:92)
    at freemarker.core.Environment.visit(Environment.java:221)
    at freemarker.core.Environment.process(Environment.java:199)
    at freemarker.template.Template.process(Template.java:259)
    at com.tactfactory.mda.template.SQLiteAdapterGenerator.makeSourceControler(SQLiteAdapterGenerator.java:216)
    at com.tactfactory.mda.template.SQLiteAdapterGenerator.generate(SQLiteAdapterGenerator.java:173)
    at com.tactfactory.mda.template.SQLiteAdapterGenerator.generateAll(SQLiteAdapterGenerator.java:161)
    at com.tactfactory.mda.command.OrmCommand.generateDBForEntities(OrmCommand.java:122)
    at com.tactfactory.mda.command.OrmCommand.generateEntities(OrmCommand.java:99)
    at com.tactfactory.mda.command.OrmCommand.execute(OrmCommand.java:250)
    at com.tactfactory.mda.Harmony.findAndExecute(Harmony.java:169)
    at com.tactfactory.mda.Console.main(Console.java:63)

Recurrences


Related issues

Blocks Harmony - Evolution #1221: Gerer OneToMany et ManyToManyFermé2012-12-13

History

#2Updated by Mickael G. almost 7 years ago

cela semble lié au relation @OneToMany

Also available in: Atom PDF

Go to top
Add picture from clipboard (Maximum size: 200 MB)