This seems as though it would be a common problem but I haven't found much
information on the forum.
I create two entitys like this:
SUPERCLASS:
@Entity
@Table(name="emp_table")
@Inheritance(strategy=InheritanceType.JOINED)
public class Employee implements Serializable {
        private static final long serialVersionUID = 48L;

        private Long id;

        private String name;

        private String pass;

        private double salary;

        private Manager manager;

        private Set<Attend> attends = new HashSet<Attend>();

        private Set<Payment> payments = new HashSet<Payment>();

        @OneToMany(mappedBy="id")
        public Set<Attend> getAttends() {
                return attends;
        }

        public void setAttends(Set<Attend> attends) {
                this.attends = attends;
        }

        @Id @GeneratedValue(strategy=GenerationType.AUTO)
        @Column(name="emp_id")
        public Long getId() {
                return id;
        }

        public void setId(Long id) {
                this.id = id;
        }

        @ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE
},fetch=FetchType.EAGER)
        @JoinColumn(name = "mgr_id")
        public Manager getManager() {
                return manager;
        }

        public void setManager(Manager manager) {
                this.manager = manager;
        }

        @Column(name="emp_name")
        public String getName() {
                return name;
        }

        public void setName(String name) {
                this.name = name;
        }

        @Column(name="emp_pass")
        public String getPass() {
                return pass;
        }

        public void setPass(String pass) {
                this.pass = pass;
        }

        @OneToMany(mappedBy="id")
        public Set<Payment> getPayments() {
                return payments;
        }

        public void setPayments(Set<Payment> payments) {
                this.payments = payments;
        }

        @Column(name="emp_salary")
        public double getSalary() {
                return salary;
        }

        public void setSalary(double salary) {
                this.salary = salary;
        }

        public Employee() {
        }

        public Employee(Long id, String name, String pass, double salary,
                        Manager manager) {
                this.id = id;
                this.name = name;
                this.pass = pass;
                this.salary = salary;
                this.manager = manager;
        }
        
        public boolean equals (Object obj)
    {
                if (null == obj) return false;
                if (!(obj instanceof Employee))
        {
            return false;
        }
                else
        {
                        Employee employee = (Employee) obj;
                        if (null == this.getName() || null == 
employee.getName() )
            {
                return false;
            }
                        else
            {
                return (this.getName().equals(employee.getName()));
            }
                }
        }

        public int hashCode ()
    {
                return name.hashCode();
        }

        public String toString () {
                return super.toString();
        }
}
SUBCLASS:
@Entity
@Table(name = "mgr_table")
@PrimaryKeyJoinColumn(name = "mgr_id")
public class Manager extends Employee implements Serializable {
        private static final long serialVersionUID = 48L;

        private String dept;

        private Set<Employee> employees = new HashSet<Employee>();

        private Set<CheckBack> checks = new HashSet<CheckBack>();

        public Manager() {
        }

        public Manager(String dept) {
                this.dept = dept;
        }

        @OneToMany(mappedBy = "id")
        public Set<CheckBack> getChecks() {
                return checks;
        }

        public void setChecks(Set<CheckBack> checks) {
                this.checks = checks;
        }

        @Column(name = "dept_name", nullable = false, length = 50)
        public String getDept() {
                return dept;
        }

        public void setDept(String dept) {
                this.dept = dept;
        }

        @OneToMany(mappedBy = "id")
        public Set<Employee> getEmployees() {
                return employees;
        }

        public void setEmployees(Set<Employee> employees) {
                this.employees = employees;
        }
}
------------------
I receive the error indication like this when I execute the command "mvn
appfuse:gen -Dentity=Manager":
D:\Program Files\eclipse\workspace\myworkflow>mvn appfuse:gen
-Dentity=Manager
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'appfuse'.
[INFO] org.apache.maven.plugins: checking for updates from appfuse
[WARNING] repository metadata for: 'org.apache.maven.plugins' could not be
retrieved from repository: appfuse due to an error: Error transferring file
[INFO] Repository 'appfuse' will be blacklisted
[INFO]
------------------------------------------------------------------------
[INFO] Building Personal WorkFlow System
[INFO]    task-segment: [appfuse:gen]
[INFO]
------------------------------------------------------------------------
[INFO] Preparing appfuse:gen
[INFO] [aspectj:compile {execution: default}]
[INFO] [native2ascii:native2ascii {execution: native2ascii-utf8}]
[INFO] [native2ascii:native2ascii {execution: native2ascii-8859_1}]
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [appfuse:gen]
[INFO] Configuration XML file loaded: D:\Program
Files\eclipse\workspace\myworkflow\src\main\resources\hibernate.cfg.xml
[INFO] Configuration XML file loaded: D:\Program
Files\eclipse\workspace\myworkflow\src\main\resources\hibernate.cfg.xml
[INFO] src/main/resources/database.properties not found within the project.
Trying absolute path.
[INFO] No hibernate properties file loaded.
ERROR [main] runtime.error(96) |
Expression idFieldName is undefined on line 78, column 78 in
appfuse/web/jsf/for
m-view.ftl.
The problematic instruction:
----------
==> ${idFieldName} [on line 78, column 76 in appfuse/web/jsf/form-view.ftl]
----------

Java backtrace for programmers:
----------
freemarker.core.InvalidReferenceException: Expression idFieldName is
undefined o
n line 78, column 78 in appfuse/web/jsf/form-view.ftl.
        at
freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124)

        at freemarker.core.Expression.getStringValue(Expression.java:118)
        at freemarker.core.Expression.getStringValue(Expression.java:93)
        at freemarker.core.DollarVariable.accept(DollarVariable.java:76)
        at freemarker.core.Environment.visit(Environment.java:196)
        at freemarker.core.MixedContent.accept(MixedContent.java:92)
        at freemarker.core.Environment.visit(Environment.java:196)

How do I correctly map these two pieces together?Can you help me?
-- 
View this message in context: 
http://www.nabble.com/Cannt-using-gen-command-in-AppFuse-tp14414609s2369p14414609.html
Sent from the AppFuse - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to