Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Teneo 1.0.1 does not support Lazy-Loading of Many-to-One and One-to-One
Teneo 1.0.1 does not support Lazy-Loading of Many-to-One and One-to-One [message #136847] Thu, 28 May 2009 13:15 Go to next message
Ajay  is currently offline Ajay Friend
Messages: 12
Registered: July 2009
Junior Member
I was using Teneo 1.0.1, it is not supporting lazy loading for many-to-one
and one-to-one associations so I switched to Teneo 1.0.3. Now I am able
to load many-to-one and one-to-one associations lazily but I am getting
another problem with setters for EList type attributes. Teneo1.0.3
requires setters for EList type attributes while EMF does not generate
setters for such attributes, but Teneo1.0.1 was not asking for setters of
EList type attributes.
Re: Teneo 1.0.1 does not support Lazy-Loading of Many-to-One and One-to-One [message #136872 is a reply to message #136847] Fri, 29 May 2009 20:30 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Ajay,
I have missed your post, sorry. Support for Teneo is given on the EMF newsgroup which I put on the cc.

I am afraid that both situations non-lazy loading in 1.0.1 and requiring setters in teneo 1.0.3 is not what I see. None
of the testcases (more than 50 testmodels with around 200 testcases) require elist setters.

Can you describe your problem in a bit more detail? What behavior do you see, what stack traces (if any) do you get?

Also I would advice to use the latest maintenance build of Teneo 1.0.4 (it is in the bottom of the download page).

gr. Martin

Ajay wrote:
> I was using Teneo 1.0.1, it is not supporting lazy loading for
> many-to-one and one-to-one associations so I switched to Teneo 1.0.3.
> Now I am able to load many-to-one and one-to-one associations lazily but
> I am getting another problem with setters for EList type attributes.
> Teneo1.0.3 requires setters for EList type attributes while EMF does not
> generate setters for such attributes, but Teneo1.0.1 was not asking for
> setters of EList type attributes.
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: Teneo 1.0.1 does not support Lazy-Loading of Many-to-One and One-to-One [message #137130 is a reply to message #136872] Wed, 10 June 2009 11:25 Go to previous messageGo to next message
Ajay  is currently offline Ajay Friend
Messages: 12
Registered: July 2009
Junior Member
Hello Martin,

I am using two EMF classes and two DAOs (one for Employee and other one
for EmailAddresses) for performimg operations on EMF objects.

Testcases for both Employee and EmailAddresses are working fine with
Teneo1.0.1 libraries but asking "setters" for EList type attributes while
running test cases using Teneo 1.0.3 libraries.

The generated interfaces are as follows:
1.EmailAddresses
2.Employee

The generated implementation classes are as follows:
1.EmailAddressesImpl
2.EmployeeImpl

Two DAOs:
1. DAO_Employee
2. DAO_EmailAddress

The association between Employee and EmailAddresses is a bidirectional
one-to-many relationship.

I am pasting complete Hbm file, Test class and Exception Log for your
perusal.

Hbm for these two classes are listed below:
**************************************************
<?xml version="1.0" encoding="UTF-8"?>
<!-- Hibernate XML Mapping File -->
<!-- Author: U129098 -->
<!-- Modified: Thursday, January 15, 2009 1:39:10 PM -->
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping auto-import="true">
<class
name="com.person.impl.EmployeeImpl"
table="employee" entity-name="Employee" mutable="true"
dynamic-update="false"
dynamic-insert="false" select-before-update="false" lazy="false"
abstract="false">
<id name="personId" column="employee_id">
<generator class="increment" />
</id>
<property name="name" insert="true" update="true" lazy="false"
optimistic-lock="true" not-null="true">
<column name="name" sql-type="varchar" not-null="true" />
</property>
<bag name="emailAddresses" lazy="true" table="email_address"
fetch="select" cascade="all" inverse="true">
<key column="owner_id" />
<one-to-many class="com.person.impl.EmailAddressesImpl"
entity-name="EmailAddresses" />
</bag>
</class>

<class
name="com.person.impl.EmailAddressesImpl"
table="email_address" entity-name="EmailAddresses" mutable="true"
dynamic-update="false"
dynamic-insert="false" select-before-update="false" lazy="false"
abstract="false">
<id name="emailId" column="email_id">
<generator class="increment" />
</id>
<property name="emailAddress" insert="true" update="true"
lazy="false" optimistic-lock="true">
<column name="email_address" sql-type="varchar" not-null="true" />
</property>
<many-to-one name="owner" column="owner_id"
not-null="true"
class="com.person.impl.EmployeeImpl"
lazy="proxy" entity-name="Employee" cascade="all"/>
</class>
</hibernate-mapping>

**************************************************

TestClass for Employee class:

***************************************************

public class EmployeeMappingTest {
protected static final String CONTEXT_FILE_NAME = "spring.xml";
protected static final ConfigurableApplicationContext springContext = new
ClassPathXmlApplicationContext(
CONTEXT_FILE_NAME);

DAO_Employee employeeDAO = null;
SessionFactory sessionFactory = null;

/**
* SetUp method
*/
@Before
public void setUp() throws Exception {
employeeDAO = (DAO_Employee) springContext.getBean("employeeDAO");
sessionFactory = (SessionFactory) springContext
.getBean("sessionFactory");

}

@After
public void tearDown() throws Exception {
employeeDAO = null;
sessionFactory = null;
}

/**
* Test method for saving an Employee object
*/
@Test
public void testSaveEmployee() {


Employee employee = new EmployeeImpl();
EmailAddresses emailAddress = new EmailAddressesImpl();
emailAddress.setEmailAddress("ajay.chauhan@ps.net");
emailAddress.setOwner(employee);
EmailAddresses emailAddress1 = new EmailAddressesImpl();
emailAddress1.setEmailAddress("call2aps@gmail.com");
emailAddress1.setOwner(employee);
List<EmailAddresses> eList = new ArrayList<EmailAddresses>();
eList.add(emailAddress);
eList.add(emailAddress1);

employee.setName("Ajay Chauhan");
employee.getEmailAddresses().addAll(eList);

try {
Transaction tx = sessionFactory.getCurrentSession()
.beginTransaction();
employeeDAO.save(employee);

tx.commit();
} catch (Exception e) {
e.printStackTrace();
}
}

/**
* Test method for Load
*/
@Test
public void testLoadByIdID_Employee() {

// set the existing id
Integer id = 1;


Employee obj = null;

try {
Transaction txn = sessionFactory.getCurrentSession()
.beginTransaction();
obj = (Employee) sessionFactory.getCurrentSession().get("Employee",id,
LockMode.READ);

System.out.println("Employee ID :: " + obj.getPersonId());
System.out.println("Employee Name :: " + obj.getName());

List<EmailAddresses> eList = obj.getEmailAddresses();
for (EmailAddresses email : eList) {
System.out.println("Email ID :: " + email.getEmailId());
System.out.println("Email Address :: "
+ email.getEmailAddress());
}
txn.commit();

} catch (Exception e) {
e.printStackTrace();
}
}

}
*********************************************************


Exceptions are:

**********************************************************


log4j:WARN No appenders could be found for logger
(org.springframework.context.support.ClassPathXmlApplication Context).
log4j:WARN Please initialize the log4j system properly.
java.lang.ExceptionInInitializerError
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Nativ e Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknow n Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Un known
Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at
org.junit.internal.runners.TestClassMethodsRunner.createTest (TestClassMethodsRunner.java:52)
at
org.junit.internal.runners.TestClassMethodsRunner.invokeTest Method(TestClassMethodsRunner.java:58)
at
org.junit.internal.runners.TestClassMethodsRunner.run(TestCl assMethodsRunner.java:35)
at
org.junit.internal.runners.TestClassRunner$1.runUnprotected( TestClassRunner.java:42)
at
org.junit.internal.runners.BeforeAndAfterRunner.runProtected (BeforeAndAfterRunner.java:34)
at org.junit.internal.runners.TestClassRunner.run(TestClassRunn er.java:52)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.r un(JUnit4TestReference.java:45)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(Test Execution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:460)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:673)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunner.java:386)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main( RemoteTestRunner.java:196)
Caused by: org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'employeeDAO' defined in class path resource
[spring.xml]: Cannot resolve reference to bean 'employeeSessionFactory'
while setting bean property 'sessionFactory'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'employeeHbSessionDataStore' defined in class path resource
[spring.xml]: Instantiation of bean failed; nested exception is
org.springframework.beans.factory.BeanDefinitionStoreExcepti on: Factory
method [public synchronized org.eclipse.emf.teneo.hibernate.HbDataStore
com.person.teneo.
EmployeeHbHelper.createRegisterDataStore(java.lang.String,or g.hibernate.cfg.Configuration)]
threw exception; nested exception is
org.hibernate.PropertyNotFoundException: Could not find a setter for
property emailAddresses in class com.person.impl.EmployeeImpl
at
org.springframework.beans.factory.support.BeanDefinitionValu eResolver.resolveReference(BeanDefinitionValueResolver.java: 275)
at
org.springframework.beans.factory.support.BeanDefinitionValu eResolver.resolveValueIfNecessary(BeanDefinitionValueResolve r.java:104)
at
org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.applyPropertyValues(AbstractAutowireCapable BeanFactory.java:1245)
at
org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.populateBean(AbstractAutowireCapableBeanFac tory.java:1010)
at
org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFac tory.java:472)
at
org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.ja va:409)
at java.security.AccessController.doPrivileged(Native Method)
at
org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.createBean(AbstractAutowireCapableBeanFacto ry.java:380)
at
org.springframework.beans.factory.support.AbstractBeanFactor y$1.getObject(AbstractBeanFactory.java:264)
at
org.springframework.beans.factory.support.DefaultSingletonBe anRegistry.getSingleton(DefaultSingletonBeanRegistry.java:22 2)
at
org.springframework.beans.factory.support.AbstractBeanFactor y.doGetBean(AbstractBeanFactory.java:261)
at
org.springframework.beans.factory.support.AbstractBeanFactor y.getBean(AbstractBeanFactory.java:185)
at
org.springframework.beans.factory.support.AbstractBeanFactor y.getBean(AbstractBeanFactory.java:164)
at
org.springframework.beans.factory.support.DefaultListableBea nFactory.preInstantiateSingletons(DefaultListableBeanFactory .java:429)
at
org.springframework.context.support.AbstractApplicationConte xt.finishBeanFactoryInitialization(AbstractApplicationContex t.java:728)
at
org.springframework.context.support.AbstractApplicationConte xt.refresh(AbstractApplicationContext.java:380)
at
org.springframework.context.support.ClassPathXmlApplicationC ontext. <init>(ClassPathXmlApplicationContext.java:139)
at
org.springframework.context.support.ClassPathXmlApplicationC ontext. <init>(ClassPathXmlApplicationContext.java:83)
at
com.person.test.EmployeeMappingTest.<clinit>(EmployeeMappingTest.java:49)
... 16 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'employeeHbSessionDataStore' defined in class path
resource [spring.xml]: Instantiation of bean failed; nested exception is
org.springframework.beans.factory.BeanDefinitionStoreExcepti on: Factory
method [public synchronized org.eclipse.emf.teneo.hibernate.HbDataStore
com.person.teneo.EmployeeHbHelper.createRegisterDataStore(ja va.lang.String,org.hibernate.cfg.Configuration)]
threw exception; nested exception is
org.hibernate.PropertyNotFoundException: Could not find a setter for
property emailAddresses in class com.person.impl.EmployeeImpl
at
org.springframework.beans.factory.support.ConstructorResolve r.instantiateUsingFactoryMethod(ConstructorResolver.java:444 )
at
org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.instantiateUsingFactoryMethod(AbstractAutow ireCapableBeanFactory.java:903)
at
org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.createBeanInstance(AbstractAutowireCapableB eanFactory.java:817)
at
org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFac tory.java:440)
at
org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.ja va:409)
at java.security.AccessController.doPrivileged(Native Method)
at
org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.createBean(AbstractAutowireCapableBeanFacto ry.java:380)
at
org.springframework.beans.factory.support.AbstractBeanFactor y$1.getObject(AbstractBeanFactory.java:264)
at
org.springframework.beans.factory.support.DefaultSingletonBe anRegistry.getSingleton(DefaultSingletonBeanRegistry.java:22 2)
at
org.springframework.beans.factory.support.AbstractBeanFactor y.doGetBean(AbstractBeanFactory.java:261)
at
org.springframework.beans.factory.support.AbstractBeanFactor y.getBean(AbstractBeanFactory.java:185)
at
org.springframework.beans.factory.support.AbstractBeanFactor y.getBean(AbstractBeanFactory.java:164)
at
org.springframework.beans.factory.support.ConstructorResolve r.instantiateUsingFactoryMethod(ConstructorResolver.java:287 )
at
org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.instantiateUsingFactoryMethod(AbstractAutow ireCapableBeanFactory.java:903)
at
org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.createBeanInstance(AbstractAutowireCapableB eanFactory.java:817)
at
org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFac tory.java:440)
at
org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.ja va:409)
at java.security.AccessController.doPrivileged(Native Method)
at
org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.createBean(AbstractAutowireCapableBeanFacto ry.java:380)
at
org.springframework.beans.factory.support.AbstractBeanFactor y$1.getObject(AbstractBeanFactory.java:264)
at
org.springframework.beans.factory.support.DefaultSingletonBe anRegistry.getSingleton(DefaultSingletonBeanRegistry.java:22 2)
at
org.springframework.beans.factory.support.AbstractBeanFactor y.doGetBean(AbstractBeanFactory.java:261)
at
org.springframework.beans.factory.support.AbstractBeanFactor y.getBean(AbstractBeanFactory.java:185)
at
org.springframework.beans.factory.support.AbstractBeanFactor y.getBean(AbstractBeanFactory.java:164)
at
org.springframework.beans.factory.support.BeanDefinitionValu eResolver.resolveReference(BeanDefinitionValueResolver.java: 269)
... 34 more
Caused by: org.springframework.beans.factory.BeanDefinitionStoreExcepti on:
Factory method [public synchronized
org.eclipse.emf.teneo.hibernate.HbDataStore
com.person.teneo.employeeHbHelper.createRegisterDataStore(ja va.lang.String,org.hibernate.cfg.Configuration)]
threw exception; nested exception is
org.hibernate.PropertyNotFoundException: Could not find a setter for
property emailAddresses in class com.person.impl.EmployeeImpl
at
org.springframework.beans.factory.support.SimpleInstantiatio nStrategy.instantiate(SimpleInstantiationStrategy.java:127)
at
org.springframework.beans.factory.support.ConstructorResolve r.instantiateUsingFactoryMethod(ConstructorResolver.java:435 )
... 58 more
Caused by: org.hibernate.PropertyNotFoundException: Could not find a
setter for property emailAddresses in class com.person.impl.EmployeeImpl
at
org.hibernate.property.BasicPropertyAccessor.createSetter(Ba sicPropertyAccessor.java:240)
at
org.hibernate.property.BasicPropertyAccessor.getSetter(Basic PropertyAccessor.java:233)
at org.hibernate.mapping.Property.getSetter(Property.java:299)
at
org.hibernate.tuple.entity.PojoEntityTuplizer.buildPropertyS etter(PojoEntityTuplizer.java:272)
at
org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:149)
at
org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:76)
at
org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping . <init>(EntityEntityModeToTuplizerMapping.java:80)
at
org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:325)
at
org.hibernate.persister.entity.AbstractEntityPersister.<init >(AbstractEntityPersister.java:457)
at
org.hibernate.persister.entity.SingleTableEntityPersister.<init >(SingleTableEntityPersister.java:131)
at
org.hibernate.persister.PersisterFactory.createClassPersiste r(PersisterFactory.java:84)
at
org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:261)
at
org.hibernate.cfg.Configuration.buildSessionFactory(Configur ation.java:1327)
at com.person.teneo.
EmployeeHbSessionDataStore.buildSessionFactory(EmployeeHbSes sionDataStore.java:232)
at com.person.teneo.
EmployeeHbSessionDataStore.initialize(EmployeeHbSessionDataS tore.java:112)
at
com.person.teneo.EmployeeHbHelper.createRegisterDataStore(Em ployeeHbHelper.java:104)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.springframework.beans.factory.support.SimpleInstantiatio nStrategy.instantiate(SimpleInstantiationStrategy.java:115)
... 59 more
Re: Teneo 1.0.1 does not support Lazy-Loading of Many-to-One and One-to-One [message #137143 is a reply to message #137130] Wed, 10 June 2009 13:36 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
FYI, this post has been answered on the main EMF newsgroup (eclipse.tools.emf).

gr. Martin

Ajay Chauhan wrote:
> Hello Martin,
>
> I am using two EMF classes and two DAOs (one for Employee and other one
> for EmailAddresses) for performimg operations on EMF objects.
>
> Testcases for both Employee and EmailAddresses are working fine with
> Teneo1.0.1 libraries but asking "setters" for EList type attributes
> while running test cases using Teneo 1.0.3 libraries.
>
> The generated interfaces are as follows:
> 1.EmailAddresses
> 2.Employee
>
> The generated implementation classes are as follows:
> 1.EmailAddressesImpl
> 2.EmployeeImpl
>
> Two DAOs:
> 1. DAO_Employee
> 2. DAO_EmailAddress
>
> The association between Employee and EmailAddresses is a bidirectional
> one-to-many relationship.
>
> I am pasting complete Hbm file, Test class and Exception Log for your
> perusal.
>
> Hbm for these two classes are listed below:
> **************************************************
> <?xml version="1.0" encoding="UTF-8"?>
> <!-- Hibernate XML Mapping File -->
> <!-- Author: U129098 -->
> <!-- Modified: Thursday, January 15, 2009 1:39:10 PM -->
> <!DOCTYPE hibernate-mapping PUBLIC
> "-//Hibernate/Hibernate Mapping DTD//EN"
> "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
> <hibernate-mapping auto-import="true">
> <class
> name="com.person.impl.EmployeeImpl"
> table="employee" entity-name="Employee" mutable="true"
> dynamic-update="false"
> dynamic-insert="false" select-before-update="false" lazy="false"
> abstract="false">
> <id name="personId" column="employee_id">
> <generator class="increment" />
> </id>
> <property name="name" insert="true" update="true" lazy="false"
> optimistic-lock="true" not-null="true">
> <column name="name" sql-type="varchar" not-null="true" />
> </property>
> <bag name="emailAddresses" lazy="true" table="email_address"
> fetch="select" cascade="all" inverse="true">
> <key column="owner_id" />
> <one-to-many class="com.person.impl.EmailAddressesImpl"
> entity-name="EmailAddresses" />
> </bag>
> </class>
>
> <class
> name="com.person.impl.EmailAddressesImpl"
> table="email_address" entity-name="EmailAddresses"
> mutable="true" dynamic-update="false"
> dynamic-insert="false" select-before-update="false" lazy="false"
> abstract="false">
> <id name="emailId" column="email_id">
> <generator class="increment" />
> </id>
> <property name="emailAddress" insert="true" update="true"
> lazy="false" optimistic-lock="true">
> <column name="email_address" sql-type="varchar"
> not-null="true" />
> </property>
> <many-to-one name="owner" column="owner_id"
> not-null="true"
> class="com.person.impl.EmployeeImpl"
> lazy="proxy" entity-name="Employee" cascade="all"/>
> </class>
> </hibernate-mapping>
>
> **************************************************
>
> TestClass for Employee class:
>
> ***************************************************
>
> public class EmployeeMappingTest {
> protected static final String CONTEXT_FILE_NAME = "spring.xml";
> protected static final ConfigurableApplicationContext springContext
> = new ClassPathXmlApplicationContext(
> CONTEXT_FILE_NAME);
>
> DAO_Employee employeeDAO = null;
> SessionFactory sessionFactory = null;
>
> /**
> * SetUp method
> */
> @Before
> public void setUp() throws Exception {
> employeeDAO = (DAO_Employee) springContext.getBean("employeeDAO");
> sessionFactory = (SessionFactory) springContext
> .getBean("sessionFactory");
>
> }
>
> @After
> public void tearDown() throws Exception {
> employeeDAO = null;
> sessionFactory = null;
> }
>
> /**
> * Test method for saving an Employee object
> */
> @Test
> public void testSaveEmployee() {
>
>
> Employee employee = new EmployeeImpl();
> EmailAddresses emailAddress = new EmailAddressesImpl();
> emailAddress.setEmailAddress("ajay.chauhan@ps.net");
> emailAddress.setOwner(employee);
> EmailAddresses emailAddress1 = new EmailAddressesImpl();
> emailAddress1.setEmailAddress("call2aps@gmail.com");
> emailAddress1.setOwner(employee);
> List<EmailAddresses> eList = new ArrayList<EmailAddresses>();
> eList.add(emailAddress);
> eList.add(emailAddress1);
>
> employee.setName("Ajay Chauhan");
> employee.getEmailAddresses().addAll(eList);
>
> try {
> Transaction tx = sessionFactory.getCurrentSession()
> .beginTransaction();
> employeeDAO.save(employee);
>
> tx.commit();
> } catch (Exception e) {
> e.printStackTrace();
> } }
>
> /**
> * Test method for Load
> */
> @Test
> public void testLoadByIdID_Employee() {
>
> // set the existing id
> Integer id = 1;
>
>
> Employee obj = null;
>
> try {
> Transaction txn = sessionFactory.getCurrentSession()
> .beginTransaction();
> obj = (Employee)
> sessionFactory.getCurrentSession().get("Employee",id, LockMode.READ);
>
> System.out.println("Employee ID :: " + obj.getPersonId());
> System.out.println("Employee Name :: " + obj.getName());
>
> List<EmailAddresses> eList = obj.getEmailAddresses();
> for (EmailAddresses email : eList) {
> System.out.println("Email ID :: " + email.getEmailId());
> System.out.println("Email Address :: "
> + email.getEmailAddress());
> }
> txn.commit();
>
> } catch (Exception e) {
> e.printStackTrace();
> }
> }
>
> }
> *********************************************************
>
>
> Exceptions are:
>
> **********************************************************
>
>
> log4j:WARN No appenders could be found for logger
> (org.springframework.context.support.ClassPathXmlApplication Context).
> log4j:WARN Please initialize the log4j system properly.
> java.lang.ExceptionInInitializerError
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Nativ e
> Method)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknow n
> Source)
> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Un known
> Source)
> at java.lang.reflect.Constructor.newInstance(Unknown Source)
> at
> org.junit.internal.runners.TestClassMethodsRunner.createTest (TestClassMethodsRunner.java:52)
>
> at
> org.junit.internal.runners.TestClassMethodsRunner.invokeTest Method(TestClassMethodsRunner.java:58)
>
> at
> org.junit.internal.runners.TestClassMethodsRunner.run(TestCl assMethodsRunner.java:35)
>
> at
> org.junit.internal.runners.TestClassRunner$1.runUnprotected( TestClassRunner.java:42)
>
> at
> org.junit.internal.runners.BeforeAndAfterRunner.runProtected (BeforeAndAfterRunner.java:34)
>
> at
> org.junit.internal.runners.TestClassRunner.run(TestClassRunn er.java:52)
> at
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.r un(JUnit4TestReference.java:45)
>
> at
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(Test Execution.java:38)
>
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:460)
>
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:673)
>
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunner.java:386)
>
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main( RemoteTestRunner.java:196)
>
> Caused by: org.springframework.beans.factory.BeanCreationException:
> Error creating bean with name 'employeeDAO' defined in class path
> resource [spring.xml]: Cannot resolve reference to bean
> 'employeeSessionFactory' while setting bean property 'sessionFactory';
> nested exception is
> org.springframework.beans.factory.BeanCreationException: Error creating
> bean with name 'employeeHbSessionDataStore' defined in class path
> resource [spring.xml]: Instantiation of bean failed; nested exception is
> org.springframework.beans.factory.BeanDefinitionStoreExcepti on: Factory
> method [public synchronized org.eclipse.emf.teneo.hibernate.HbDataStore
> com.person.teneo.
> EmployeeHbHelper.createRegisterDataStore(java.lang.String,or g.hibernate.cfg.Configuration)]
> threw exception; nested exception is
> org.hibernate.PropertyNotFoundException: Could not find a setter for
> property emailAddresses in class com.person.impl.EmployeeImpl
> at
> org.springframework.beans.factory.support.BeanDefinitionValu eResolver.resolveReference(BeanDefinitionValueResolver.java: 275)
>
> at
> org.springframework.beans.factory.support.BeanDefinitionValu eResolver.resolveValueIfNecessary(BeanDefinitionValueResolve r.java:104)
>
> at
> org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.applyPropertyValues(AbstractAutowireCapable BeanFactory.java:1245)
>
> at
> org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.populateBean(AbstractAutowireCapableBeanFac tory.java:1010)
>
> at
> org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFac tory.java:472)
>
> at
> org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.ja va:409)
>
> at java.security.AccessController.doPrivileged(Native Method)
> at
> org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.createBean(AbstractAutowireCapableBeanFacto ry.java:380)
>
> at
> org.springframework.beans.factory.support.AbstractBeanFactor y$1.getObject(AbstractBeanFactory.java:264)
>
> at
> org.springframework.beans.factory.support.DefaultSingletonBe anRegistry.getSingleton(DefaultSingletonBeanRegistry.java:22 2)
>
> at
> org.springframework.beans.factory.support.AbstractBeanFactor y.doGetBean(AbstractBeanFactory.java:261)
>
> at
> org.springframework.beans.factory.support.AbstractBeanFactor y.getBean(AbstractBeanFactory.java:185)
>
> at
> org.springframework.beans.factory.support.AbstractBeanFactor y.getBean(AbstractBeanFactory.java:164)
>
> at
> org.springframework.beans.factory.support.DefaultListableBea nFactory.preInstantiateSingletons(DefaultListableBeanFactory .java:429)
>
> at
> org.springframework.context.support.AbstractApplicationConte xt.finishBeanFactoryInitialization(AbstractApplicationContex t.java:728)
>
> at
> org.springframework.context.support.AbstractApplicationConte xt.refresh(AbstractApplicationContext.java:380)
>
> at
> org.springframework.context.support.ClassPathXmlApplicationC ontext. <init>(ClassPathXmlApplicationContext.java:139)
>
> at
> org.springframework.context.support.ClassPathXmlApplicationC ontext. <init>(ClassPathXmlApplicationContext.java:83)
>
> at
> com.person.test.EmployeeMappingTest.<clinit>(EmployeeMappingTest.java:49)
> ... 16 more
> Caused by: org.springframework.beans.factory.BeanCreationException:
> Error creating bean with name 'employeeHbSessionDataStore' defined in
> class path resource [spring.xml]: Instantiation of bean failed; nested
> exception is
> org.springframework.beans.factory.BeanDefinitionStoreExcepti on: Factory
> method [public synchronized org.eclipse.emf.teneo.hibernate.HbDataStore
> com.person.teneo.EmployeeHbHelper.createRegisterDataStore(ja va.lang.String,org.hibernate.cfg.Configuration)]
> threw exception; nested exception is
> org.hibernate.PropertyNotFoundException: Could not find a setter for
> property emailAddresses in class com.person.impl.EmployeeImpl
> at
> org.springframework.beans.factory.support.ConstructorResolve r.instantiateUsingFactoryMethod(ConstructorResolver.java:444 )
>
> at
> org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.instantiateUsingFactoryMethod(AbstractAutow ireCapableBeanFactory.java:903)
>
> at
> org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.createBeanInstance(AbstractAutowireCapableB eanFactory.java:817)
>
> at
> org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFac tory.java:440)
>
> at
> org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.ja va:409)
>
> at java.security.AccessController.doPrivileged(Native Method)
> at
> org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.createBean(AbstractAutowireCapableBeanFacto ry.java:380)
>
> at
> org.springframework.beans.factory.support.AbstractBeanFactor y$1.getObject(AbstractBeanFactory.java:264)
>
> at
> org.springframework.beans.factory.support.DefaultSingletonBe anRegistry.getSingleton(DefaultSingletonBeanRegistry.java:22 2)
>
> at
> org.springframework.beans.factory.support.AbstractBeanFactor y.doGetBean(AbstractBeanFactory.java:261)
>
> at
> org.springframework.beans.factory.support.AbstractBeanFactor y.getBean(AbstractBeanFactory.java:185)
>
> at
> org.springframework.beans.factory.support.AbstractBeanFactor y.getBean(AbstractBeanFactory.java:164)
>
> at
> org.springframework.beans.factory.support.ConstructorResolve r.instantiateUsingFactoryMethod(ConstructorResolver.java:287 )
>
> at
> org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.instantiateUsingFactoryMethod(AbstractAutow ireCapableBeanFactory.java:903)
>
> at
> org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.createBeanInstance(AbstractAutowireCapableB eanFactory.java:817)
>
> at
> org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFac tory.java:440)
>
> at
> org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.ja va:409)
>
> at java.security.AccessController.doPrivileged(Native Method)
> at
> org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.createBean(AbstractAutowireCapableBeanFacto ry.java:380)
>
> at
> org.springframework.beans.factory.support.AbstractBeanFactor y$1.getObject(AbstractBeanFactory.java:264)
>
> at
> org.springframework.beans.factory.support.DefaultSingletonBe anRegistry.getSingleton(DefaultSingletonBeanRegistry.java:22 2)
>
> at
> org.springframework.beans.factory.support.AbstractBeanFactor y.doGetBean(AbstractBeanFactory.java:261)
>
> at
> org.springframework.beans.factory.support.AbstractBeanFactor y.getBean(AbstractBeanFactory.java:185)
>
> at
> org.springframework.beans.factory.support.AbstractBeanFactor y.getBean(AbstractBeanFactory.java:164)
>
> at
> org.springframework.beans.factory.support.BeanDefinitionValu eResolver.resolveReference(BeanDefinitionValueResolver.java: 269)
>
> ... 34 more
> Caused by:
> org.springframework.beans.factory.BeanDefinitionStoreExcepti on: Factory
> method [public synchronized org.eclipse.emf.teneo.hibernate.HbDataStore
> com.person.teneo.employeeHbHelper.createRegisterDataStore(ja va.lang.String,org.hibernate.cfg.Configuration)]
> threw exception; nested exception is
> org.hibernate.PropertyNotFoundException: Could not find a setter for
> property emailAddresses in class com.person.impl.EmployeeImpl
> at
> org.springframework.beans.factory.support.SimpleInstantiatio nStrategy.instantiate(SimpleInstantiationStrategy.java:127)
>
> at
> org.springframework.beans.factory.support.ConstructorResolve r.instantiateUsingFactoryMethod(ConstructorResolver.java:435 )
>
> ... 58 more
> Caused by: org.hibernate.PropertyNotFoundException: Could not find a
> setter for property emailAddresses in class com.person.impl.EmployeeImpl
> at
> org.hibernate.property.BasicPropertyAccessor.createSetter(Ba sicPropertyAccessor.java:240)
>
> at
> org.hibernate.property.BasicPropertyAccessor.getSetter(Basic PropertyAccessor.java:233)
>
> at org.hibernate.mapping.Property.getSetter(Property.java:299)
> at
> org.hibernate.tuple.entity.PojoEntityTuplizer.buildPropertyS etter(PojoEntityTuplizer.java:272)
>
> at
> org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:149)
>
> at
> org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:76)
>
> at
> org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping . <init>(EntityEntityModeToTuplizerMapping.java:80)
>
> at
> org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:325)
> at
> org.hibernate.persister.entity.AbstractEntityPersister.<init >(AbstractEntityPersister.java:457)
>
> at
> org.hibernate.persister.entity.SingleTableEntityPersister.<init >(SingleTableEntityPersister.java:131)
>
> at
> org.hibernate.persister.PersisterFactory.createClassPersiste r(PersisterFactory.java:84)
>
> at
> org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:261)
> at
> org.hibernate.cfg.Configuration.buildSessionFactory(Configur ation.java:1327)
>
> at com.person.teneo.
> EmployeeHbSessionDataStore.buildSessionFactory(EmployeeHbSes sionDataStore.java:232)
>
> at com.person.teneo.
> EmployeeHbSessionDataStore.initialize(EmployeeHbSessionDataS tore.java:112)
> at
> com.person.teneo.EmployeeHbHelper.createRegisterDataStore(Em ployeeHbHelper.java:104)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at
> org.springframework.beans.factory.support.SimpleInstantiatio nStrategy.instantiate(SimpleInstantiationStrategy.java:115)
>
> ... 59 more
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: Teneo 1.0.1 does not support Lazy-Loading of Many-to-One and One-to-One [message #620988 is a reply to message #136847] Fri, 29 May 2009 20:30 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Ajay,
I have missed your post, sorry. Support for Teneo is given on the EMF newsgroup which I put on the cc.

I am afraid that both situations non-lazy loading in 1.0.1 and requiring setters in teneo 1.0.3 is not what I see. None
of the testcases (more than 50 testmodels with around 200 testcases) require elist setters.

Can you describe your problem in a bit more detail? What behavior do you see, what stack traces (if any) do you get?

Also I would advice to use the latest maintenance build of Teneo 1.0.4 (it is in the bottom of the download page).

gr. Martin

Ajay wrote:
> I was using Teneo 1.0.1, it is not supporting lazy loading for
> many-to-one and one-to-one associations so I switched to Teneo 1.0.3.
> Now I am able to load many-to-one and one-to-one associations lazily but
> I am getting another problem with setters for EList type attributes.
> Teneo1.0.3 requires setters for EList type attributes while EMF does not
> generate setters for such attributes, but Teneo1.0.1 was not asking for
> setters of EList type attributes.
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: Teneo 1.0.1 does not support Lazy-Loading of Many-to-One and One-to-One [message #621010 is a reply to message #136872] Wed, 10 June 2009 11:25 Go to previous message
Ajay  is currently offline Ajay Friend
Messages: 12
Registered: July 2009
Junior Member
Hello Martin,

I am using two EMF classes and two DAOs (one for Employee and other one
for EmailAddresses) for performimg operations on EMF objects.

Testcases for both Employee and EmailAddresses are working fine with
Teneo1.0.1 libraries but asking "setters" for EList type attributes while
running test cases using Teneo 1.0.3 libraries.

The generated interfaces are as follows:
1.EmailAddresses
2.Employee

The generated implementation classes are as follows:
1.EmailAddressesImpl
2.EmployeeImpl

Two DAOs:
1. DAO_Employee
2. DAO_EmailAddress

The association between Employee and EmailAddresses is a bidirectional
one-to-many relationship.

I am pasting complete Hbm file, Test class and Exception Log for your
perusal.

Hbm for these two classes are listed below:
**************************************************
<?xml version="1.0" encoding="UTF-8"?>
<!-- Hibernate XML Mapping File -->
<!-- Author: U129098 -->
<!-- Modified: Thursday, January 15, 2009 1:39:10 PM -->
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping auto-import="true">
<class
name="com.person.impl.EmployeeImpl"
table="employee" entity-name="Employee" mutable="true"
dynamic-update="false"
dynamic-insert="false" select-before-update="false" lazy="false"
abstract="false">
<id name="personId" column="employee_id">
<generator class="increment" />
</id>
<property name="name" insert="true" update="true" lazy="false"
optimistic-lock="true" not-null="true">
<column name="name" sql-type="varchar" not-null="true" />
</property>
<bag name="emailAddresses" lazy="true" table="email_address"
fetch="select" cascade="all" inverse="true">
<key column="owner_id" />
<one-to-many class="com.person.impl.EmailAddressesImpl"
entity-name="EmailAddresses" />
</bag>
</class>

<class
name="com.person.impl.EmailAddressesImpl"
table="email_address" entity-name="EmailAddresses" mutable="true"
dynamic-update="false"
dynamic-insert="false" select-before-update="false" lazy="false"
abstract="false">
<id name="emailId" column="email_id">
<generator class="increment" />
</id>
<property name="emailAddress" insert="true" update="true"
lazy="false" optimistic-lock="true">
<column name="email_address" sql-type="varchar" not-null="true" />
</property>
<many-to-one name="owner" column="owner_id"
not-null="true"
class="com.person.impl.EmployeeImpl"
lazy="proxy" entity-name="Employee" cascade="all"/>
</class>
</hibernate-mapping>

**************************************************

TestClass for Employee class:

***************************************************

public class EmployeeMappingTest {
protected static final String CONTEXT_FILE_NAME = "spring.xml";
protected static final ConfigurableApplicationContext springContext = new
ClassPathXmlApplicationContext(
CONTEXT_FILE_NAME);

DAO_Employee employeeDAO = null;
SessionFactory sessionFactory = null;

/**
* SetUp method
*/
@Before
public void setUp() throws Exception {
employeeDAO = (DAO_Employee) springContext.getBean("employeeDAO");
sessionFactory = (SessionFactory) springContext
.getBean("sessionFactory");

}

@After
public void tearDown() throws Exception {
employeeDAO = null;
sessionFactory = null;
}

/**
* Test method for saving an Employee object
*/
@Test
public void testSaveEmployee() {


Employee employee = new EmployeeImpl();
EmailAddresses emailAddress = new EmailAddressesImpl();
emailAddress.setEmailAddress("ajay.chauhan@ps.net");
emailAddress.setOwner(employee);
EmailAddresses emailAddress1 = new EmailAddressesImpl();
emailAddress1.setEmailAddress("call2aps@gmail.com");
emailAddress1.setOwner(employee);
List<EmailAddresses> eList = new ArrayList<EmailAddresses>();
eList.add(emailAddress);
eList.add(emailAddress1);

employee.setName("Ajay Chauhan");
employee.getEmailAddresses().addAll(eList);

try {
Transaction tx = sessionFactory.getCurrentSession()
.beginTransaction();
employeeDAO.save(employee);

tx.commit();
} catch (Exception e) {
e.printStackTrace();
}
}

/**
* Test method for Load
*/
@Test
public void testLoadByIdID_Employee() {

// set the existing id
Integer id = 1;


Employee obj = null;

try {
Transaction txn = sessionFactory.getCurrentSession()
.beginTransaction();
obj = (Employee) sessionFactory.getCurrentSession().get("Employee",id,
LockMode.READ);

System.out.println("Employee ID :: " + obj.getPersonId());
System.out.println("Employee Name :: " + obj.getName());

List<EmailAddresses> eList = obj.getEmailAddresses();
for (EmailAddresses email : eList) {
System.out.println("Email ID :: " + email.getEmailId());
System.out.println("Email Address :: "
+ email.getEmailAddress());
}
txn.commit();

} catch (Exception e) {
e.printStackTrace();
}
}

}
*********************************************************


Exceptions are:

**********************************************************


log4j:WARN No appenders could be found for logger
(org.springframework.context.support.ClassPathXmlApplication Context).
log4j:WARN Please initialize the log4j system properly.
java.lang.ExceptionInInitializerError
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Nativ e Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknow n Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Un known
Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at
org.junit.internal.runners.TestClassMethodsRunner.createTest (TestClassMethodsRunner.java:52)
at
org.junit.internal.runners.TestClassMethodsRunner.invokeTest Method(TestClassMethodsRunner.java:58)
at
org.junit.internal.runners.TestClassMethodsRunner.run(TestCl assMethodsRunner.java:35)
at
org.junit.internal.runners.TestClassRunner$1.runUnprotected( TestClassRunner.java:42)
at
org.junit.internal.runners.BeforeAndAfterRunner.runProtected (BeforeAndAfterRunner.java:34)
at org.junit.internal.runners.TestClassRunner.run(TestClassRunn er.java:52)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.r un(JUnit4TestReference.java:45)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(Test Execution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:460)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:673)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunner.java:386)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main( RemoteTestRunner.java:196)
Caused by: org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'employeeDAO' defined in class path resource
[spring.xml]: Cannot resolve reference to bean 'employeeSessionFactory'
while setting bean property 'sessionFactory'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'employeeHbSessionDataStore' defined in class path resource
[spring.xml]: Instantiation of bean failed; nested exception is
org.springframework.beans.factory.BeanDefinitionStoreExcepti on: Factory
method [public synchronized org.eclipse.emf.teneo.hibernate.HbDataStore
com.person.teneo.
EmployeeHbHelper.createRegisterDataStore(java.lang.String,or g.hibernate.cfg.Configuration)]
threw exception; nested exception is
org.hibernate.PropertyNotFoundException: Could not find a setter for
property emailAddresses in class com.person.impl.EmployeeImpl
at
org.springframework.beans.factory.support.BeanDefinitionValu eResolver.resolveReference(BeanDefinitionValueResolver.java: 275)
at
org.springframework.beans.factory.support.BeanDefinitionValu eResolver.resolveValueIfNecessary(BeanDefinitionValueResolve r.java:104)
at
org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.applyPropertyValues(AbstractAutowireCapable BeanFactory.java:1245)
at
org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.populateBean(AbstractAutowireCapableBeanFac tory.java:1010)
at
org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFac tory.java:472)
at
org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.ja va:409)
at java.security.AccessController.doPrivileged(Native Method)
at
org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.createBean(AbstractAutowireCapableBeanFacto ry.java:380)
at
org.springframework.beans.factory.support.AbstractBeanFactor y$1.getObject(AbstractBeanFactory.java:264)
at
org.springframework.beans.factory.support.DefaultSingletonBe anRegistry.getSingleton(DefaultSingletonBeanRegistry.java:22 2)
at
org.springframework.beans.factory.support.AbstractBeanFactor y.doGetBean(AbstractBeanFactory.java:261)
at
org.springframework.beans.factory.support.AbstractBeanFactor y.getBean(AbstractBeanFactory.java:185)
at
org.springframework.beans.factory.support.AbstractBeanFactor y.getBean(AbstractBeanFactory.java:164)
at
org.springframework.beans.factory.support.DefaultListableBea nFactory.preInstantiateSingletons(DefaultListableBeanFactory .java:429)
at
org.springframework.context.support.AbstractApplicationConte xt.finishBeanFactoryInitialization(AbstractApplicationContex t.java:728)
at
org.springframework.context.support.AbstractApplicationConte xt.refresh(AbstractApplicationContext.java:380)
at
org.springframework.context.support.ClassPathXmlApplicationC ontext. <init>(ClassPathXmlApplicationContext.java:139)
at
org.springframework.context.support.ClassPathXmlApplicationC ontext. <init>(ClassPathXmlApplicationContext.java:83)
at
com.person.test.EmployeeMappingTest.<clinit>(EmployeeMappingTest.java:49)
... 16 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'employeeHbSessionDataStore' defined in class path
resource [spring.xml]: Instantiation of bean failed; nested exception is
org.springframework.beans.factory.BeanDefinitionStoreExcepti on: Factory
method [public synchronized org.eclipse.emf.teneo.hibernate.HbDataStore
com.person.teneo.EmployeeHbHelper.createRegisterDataStore(ja va.lang.String,org.hibernate.cfg.Configuration)]
threw exception; nested exception is
org.hibernate.PropertyNotFoundException: Could not find a setter for
property emailAddresses in class com.person.impl.EmployeeImpl
at
org.springframework.beans.factory.support.ConstructorResolve r.instantiateUsingFactoryMethod(ConstructorResolver.java:444 )
at
org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.instantiateUsingFactoryMethod(AbstractAutow ireCapableBeanFactory.java:903)
at
org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.createBeanInstance(AbstractAutowireCapableB eanFactory.java:817)
at
org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFac tory.java:440)
at
org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.ja va:409)
at java.security.AccessController.doPrivileged(Native Method)
at
org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.createBean(AbstractAutowireCapableBeanFacto ry.java:380)
at
org.springframework.beans.factory.support.AbstractBeanFactor y$1.getObject(AbstractBeanFactory.java:264)
at
org.springframework.beans.factory.support.DefaultSingletonBe anRegistry.getSingleton(DefaultSingletonBeanRegistry.java:22 2)
at
org.springframework.beans.factory.support.AbstractBeanFactor y.doGetBean(AbstractBeanFactory.java:261)
at
org.springframework.beans.factory.support.AbstractBeanFactor y.getBean(AbstractBeanFactory.java:185)
at
org.springframework.beans.factory.support.AbstractBeanFactor y.getBean(AbstractBeanFactory.java:164)
at
org.springframework.beans.factory.support.ConstructorResolve r.instantiateUsingFactoryMethod(ConstructorResolver.java:287 )
at
org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.instantiateUsingFactoryMethod(AbstractAutow ireCapableBeanFactory.java:903)
at
org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.createBeanInstance(AbstractAutowireCapableB eanFactory.java:817)
at
org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFac tory.java:440)
at
org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.ja va:409)
at java.security.AccessController.doPrivileged(Native Method)
at
org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.createBean(AbstractAutowireCapableBeanFacto ry.java:380)
at
org.springframework.beans.factory.support.AbstractBeanFactor y$1.getObject(AbstractBeanFactory.java:264)
at
org.springframework.beans.factory.support.DefaultSingletonBe anRegistry.getSingleton(DefaultSingletonBeanRegistry.java:22 2)
at
org.springframework.beans.factory.support.AbstractBeanFactor y.doGetBean(AbstractBeanFactory.java:261)
at
org.springframework.beans.factory.support.AbstractBeanFactor y.getBean(AbstractBeanFactory.java:185)
at
org.springframework.beans.factory.support.AbstractBeanFactor y.getBean(AbstractBeanFactory.java:164)
at
org.springframework.beans.factory.support.BeanDefinitionValu eResolver.resolveReference(BeanDefinitionValueResolver.java: 269)
... 34 more
Caused by: org.springframework.beans.factory.BeanDefinitionStoreExcepti on:
Factory method [public synchronized
org.eclipse.emf.teneo.hibernate.HbDataStore
com.person.teneo.employeeHbHelper.createRegisterDataStore(ja va.lang.String,org.hibernate.cfg.Configuration)]
threw exception; nested exception is
org.hibernate.PropertyNotFoundException: Could not find a setter for
property emailAddresses in class com.person.impl.EmployeeImpl
at
org.springframework.beans.factory.support.SimpleInstantiatio nStrategy.instantiate(SimpleInstantiationStrategy.java:127)
at
org.springframework.beans.factory.support.ConstructorResolve r.instantiateUsingFactoryMethod(ConstructorResolver.java:435 )
... 58 more
Caused by: org.hibernate.PropertyNotFoundException: Could not find a
setter for property emailAddresses in class com.person.impl.EmployeeImpl
at
org.hibernate.property.BasicPropertyAccessor.createSetter(Ba sicPropertyAccessor.java:240)
at
org.hibernate.property.BasicPropertyAccessor.getSetter(Basic PropertyAccessor.java:233)
at org.hibernate.mapping.Property.getSetter(Property.java:299)
at
org.hibernate.tuple.entity.PojoEntityTuplizer.buildPropertyS etter(PojoEntityTuplizer.java:272)
at
org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:149)
at
org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:76)
at
org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping . <init>(EntityEntityModeToTuplizerMapping.java:80)
at
org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:325)
at
org.hibernate.persister.entity.AbstractEntityPersister.<init >(AbstractEntityPersister.java:457)
at
org.hibernate.persister.entity.SingleTableEntityPersister.<init >(SingleTableEntityPersister.java:131)
at
org.hibernate.persister.PersisterFactory.createClassPersiste r(PersisterFactory.java:84)
at
org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:261)
at
org.hibernate.cfg.Configuration.buildSessionFactory(Configur ation.java:1327)
at com.person.teneo.
EmployeeHbSessionDataStore.buildSessionFactory(EmployeeHbSes sionDataStore.java:232)
at com.person.teneo.
EmployeeHbSessionDataStore.initialize(EmployeeHbSessionDataS tore.java:112)
at
com.person.teneo.EmployeeHbHelper.createRegisterDataStore(Em ployeeHbHelper.java:104)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.springframework.beans.factory.support.SimpleInstantiatio nStrategy.instantiate(SimpleInstantiationStrategy.java:115)
... 59 more
Re: Teneo 1.0.1 does not support Lazy-Loading of Many-to-One and One-to-One [message #621011 is a reply to message #137130] Wed, 10 June 2009 13:36 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
FYI, this post has been answered on the main EMF newsgroup (eclipse.tools.emf).

gr. Martin

Ajay Chauhan wrote:
> Hello Martin,
>
> I am using two EMF classes and two DAOs (one for Employee and other one
> for EmailAddresses) for performimg operations on EMF objects.
>
> Testcases for both Employee and EmailAddresses are working fine with
> Teneo1.0.1 libraries but asking "setters" for EList type attributes
> while running test cases using Teneo 1.0.3 libraries.
>
> The generated interfaces are as follows:
> 1.EmailAddresses
> 2.Employee
>
> The generated implementation classes are as follows:
> 1.EmailAddressesImpl
> 2.EmployeeImpl
>
> Two DAOs:
> 1. DAO_Employee
> 2. DAO_EmailAddress
>
> The association between Employee and EmailAddresses is a bidirectional
> one-to-many relationship.
>
> I am pasting complete Hbm file, Test class and Exception Log for your
> perusal.
>
> Hbm for these two classes are listed below:
> **************************************************
> <?xml version="1.0" encoding="UTF-8"?>
> <!-- Hibernate XML Mapping File -->
> <!-- Author: U129098 -->
> <!-- Modified: Thursday, January 15, 2009 1:39:10 PM -->
> <!DOCTYPE hibernate-mapping PUBLIC
> "-//Hibernate/Hibernate Mapping DTD//EN"
> "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
> <hibernate-mapping auto-import="true">
> <class
> name="com.person.impl.EmployeeImpl"
> table="employee" entity-name="Employee" mutable="true"
> dynamic-update="false"
> dynamic-insert="false" select-before-update="false" lazy="false"
> abstract="false">
> <id name="personId" column="employee_id">
> <generator class="increment" />
> </id>
> <property name="name" insert="true" update="true" lazy="false"
> optimistic-lock="true" not-null="true">
> <column name="name" sql-type="varchar" not-null="true" />
> </property>
> <bag name="emailAddresses" lazy="true" table="email_address"
> fetch="select" cascade="all" inverse="true">
> <key column="owner_id" />
> <one-to-many class="com.person.impl.EmailAddressesImpl"
> entity-name="EmailAddresses" />
> </bag>
> </class>
>
> <class
> name="com.person.impl.EmailAddressesImpl"
> table="email_address" entity-name="EmailAddresses"
> mutable="true" dynamic-update="false"
> dynamic-insert="false" select-before-update="false" lazy="false"
> abstract="false">
> <id name="emailId" column="email_id">
> <generator class="increment" />
> </id>
> <property name="emailAddress" insert="true" update="true"
> lazy="false" optimistic-lock="true">
> <column name="email_address" sql-type="varchar"
> not-null="true" />
> </property>
> <many-to-one name="owner" column="owner_id"
> not-null="true"
> class="com.person.impl.EmployeeImpl"
> lazy="proxy" entity-name="Employee" cascade="all"/>
> </class>
> </hibernate-mapping>
>
> **************************************************
>
> TestClass for Employee class:
>
> ***************************************************
>
> public class EmployeeMappingTest {
> protected static final String CONTEXT_FILE_NAME = "spring.xml";
> protected static final ConfigurableApplicationContext springContext
> = new ClassPathXmlApplicationContext(
> CONTEXT_FILE_NAME);
>
> DAO_Employee employeeDAO = null;
> SessionFactory sessionFactory = null;
>
> /**
> * SetUp method
> */
> @Before
> public void setUp() throws Exception {
> employeeDAO = (DAO_Employee) springContext.getBean("employeeDAO");
> sessionFactory = (SessionFactory) springContext
> .getBean("sessionFactory");
>
> }
>
> @After
> public void tearDown() throws Exception {
> employeeDAO = null;
> sessionFactory = null;
> }
>
> /**
> * Test method for saving an Employee object
> */
> @Test
> public void testSaveEmployee() {
>
>
> Employee employee = new EmployeeImpl();
> EmailAddresses emailAddress = new EmailAddressesImpl();
> emailAddress.setEmailAddress("ajay.chauhan@ps.net");
> emailAddress.setOwner(employee);
> EmailAddresses emailAddress1 = new EmailAddressesImpl();
> emailAddress1.setEmailAddress("call2aps@gmail.com");
> emailAddress1.setOwner(employee);
> List<EmailAddresses> eList = new ArrayList<EmailAddresses>();
> eList.add(emailAddress);
> eList.add(emailAddress1);
>
> employee.setName("Ajay Chauhan");
> employee.getEmailAddresses().addAll(eList);
>
> try {
> Transaction tx = sessionFactory.getCurrentSession()
> .beginTransaction();
> employeeDAO.save(employee);
>
> tx.commit();
> } catch (Exception e) {
> e.printStackTrace();
> } }
>
> /**
> * Test method for Load
> */
> @Test
> public void testLoadByIdID_Employee() {
>
> // set the existing id
> Integer id = 1;
>
>
> Employee obj = null;
>
> try {
> Transaction txn = sessionFactory.getCurrentSession()
> .beginTransaction();
> obj = (Employee)
> sessionFactory.getCurrentSession().get("Employee",id, LockMode.READ);
>
> System.out.println("Employee ID :: " + obj.getPersonId());
> System.out.println("Employee Name :: " + obj.getName());
>
> List<EmailAddresses> eList = obj.getEmailAddresses();
> for (EmailAddresses email : eList) {
> System.out.println("Email ID :: " + email.getEmailId());
> System.out.println("Email Address :: "
> + email.getEmailAddress());
> }
> txn.commit();
>
> } catch (Exception e) {
> e.printStackTrace();
> }
> }
>
> }
> *********************************************************
>
>
> Exceptions are:
>
> **********************************************************
>
>
> log4j:WARN No appenders could be found for logger
> (org.springframework.context.support.ClassPathXmlApplication Context).
> log4j:WARN Please initialize the log4j system properly.
> java.lang.ExceptionInInitializerError
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Nativ e
> Method)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknow n
> Source)
> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Un known
> Source)
> at java.lang.reflect.Constructor.newInstance(Unknown Source)
> at
> org.junit.internal.runners.TestClassMethodsRunner.createTest (TestClassMethodsRunner.java:52)
>
> at
> org.junit.internal.runners.TestClassMethodsRunner.invokeTest Method(TestClassMethodsRunner.java:58)
>
> at
> org.junit.internal.runners.TestClassMethodsRunner.run(TestCl assMethodsRunner.java:35)
>
> at
> org.junit.internal.runners.TestClassRunner$1.runUnprotected( TestClassRunner.java:42)
>
> at
> org.junit.internal.runners.BeforeAndAfterRunner.runProtected (BeforeAndAfterRunner.java:34)
>
> at
> org.junit.internal.runners.TestClassRunner.run(TestClassRunn er.java:52)
> at
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.r un(JUnit4TestReference.java:45)
>
> at
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(Test Execution.java:38)
>
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:460)
>
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:673)
>
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunner.java:386)
>
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main( RemoteTestRunner.java:196)
>
> Caused by: org.springframework.beans.factory.BeanCreationException:
> Error creating bean with name 'employeeDAO' defined in class path
> resource [spring.xml]: Cannot resolve reference to bean
> 'employeeSessionFactory' while setting bean property 'sessionFactory';
> nested exception is
> org.springframework.beans.factory.BeanCreationException: Error creating
> bean with name 'employeeHbSessionDataStore' defined in class path
> resource [spring.xml]: Instantiation of bean failed; nested exception is
> org.springframework.beans.factory.BeanDefinitionStoreExcepti on: Factory
> method [public synchronized org.eclipse.emf.teneo.hibernate.HbDataStore
> com.person.teneo.
> EmployeeHbHelper.createRegisterDataStore(java.lang.String,or g.hibernate.cfg.Configuration)]
> threw exception; nested exception is
> org.hibernate.PropertyNotFoundException: Could not find a setter for
> property emailAddresses in class com.person.impl.EmployeeImpl
> at
> org.springframework.beans.factory.support.BeanDefinitionValu eResolver.resolveReference(BeanDefinitionValueResolver.java: 275)
>
> at
> org.springframework.beans.factory.support.BeanDefinitionValu eResolver.resolveValueIfNecessary(BeanDefinitionValueResolve r.java:104)
>
> at
> org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.applyPropertyValues(AbstractAutowireCapable BeanFactory.java:1245)
>
> at
> org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.populateBean(AbstractAutowireCapableBeanFac tory.java:1010)
>
> at
> org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFac tory.java:472)
>
> at
> org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.ja va:409)
>
> at java.security.AccessController.doPrivileged(Native Method)
> at
> org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.createBean(AbstractAutowireCapableBeanFacto ry.java:380)
>
> at
> org.springframework.beans.factory.support.AbstractBeanFactor y$1.getObject(AbstractBeanFactory.java:264)
>
> at
> org.springframework.beans.factory.support.DefaultSingletonBe anRegistry.getSingleton(DefaultSingletonBeanRegistry.java:22 2)
>
> at
> org.springframework.beans.factory.support.AbstractBeanFactor y.doGetBean(AbstractBeanFactory.java:261)
>
> at
> org.springframework.beans.factory.support.AbstractBeanFactor y.getBean(AbstractBeanFactory.java:185)
>
> at
> org.springframework.beans.factory.support.AbstractBeanFactor y.getBean(AbstractBeanFactory.java:164)
>
> at
> org.springframework.beans.factory.support.DefaultListableBea nFactory.preInstantiateSingletons(DefaultListableBeanFactory .java:429)
>
> at
> org.springframework.context.support.AbstractApplicationConte xt.finishBeanFactoryInitialization(AbstractApplicationContex t.java:728)
>
> at
> org.springframework.context.support.AbstractApplicationConte xt.refresh(AbstractApplicationContext.java:380)
>
> at
> org.springframework.context.support.ClassPathXmlApplicationC ontext. <init>(ClassPathXmlApplicationContext.java:139)
>
> at
> org.springframework.context.support.ClassPathXmlApplicationC ontext. <init>(ClassPathXmlApplicationContext.java:83)
>
> at
> com.person.test.EmployeeMappingTest.<clinit>(EmployeeMappingTest.java:49)
> ... 16 more
> Caused by: org.springframework.beans.factory.BeanCreationException:
> Error creating bean with name 'employeeHbSessionDataStore' defined in
> class path resource [spring.xml]: Instantiation of bean failed; nested
> exception is
> org.springframework.beans.factory.BeanDefinitionStoreExcepti on: Factory
> method [public synchronized org.eclipse.emf.teneo.hibernate.HbDataStore
> com.person.teneo.EmployeeHbHelper.createRegisterDataStore(ja va.lang.String,org.hibernate.cfg.Configuration)]
> threw exception; nested exception is
> org.hibernate.PropertyNotFoundException: Could not find a setter for
> property emailAddresses in class com.person.impl.EmployeeImpl
> at
> org.springframework.beans.factory.support.ConstructorResolve r.instantiateUsingFactoryMethod(ConstructorResolver.java:444 )
>
> at
> org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.instantiateUsingFactoryMethod(AbstractAutow ireCapableBeanFactory.java:903)
>
> at
> org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.createBeanInstance(AbstractAutowireCapableB eanFactory.java:817)
>
> at
> org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFac tory.java:440)
>
> at
> org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.ja va:409)
>
> at java.security.AccessController.doPrivileged(Native Method)
> at
> org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.createBean(AbstractAutowireCapableBeanFacto ry.java:380)
>
> at
> org.springframework.beans.factory.support.AbstractBeanFactor y$1.getObject(AbstractBeanFactory.java:264)
>
> at
> org.springframework.beans.factory.support.DefaultSingletonBe anRegistry.getSingleton(DefaultSingletonBeanRegistry.java:22 2)
>
> at
> org.springframework.beans.factory.support.AbstractBeanFactor y.doGetBean(AbstractBeanFactory.java:261)
>
> at
> org.springframework.beans.factory.support.AbstractBeanFactor y.getBean(AbstractBeanFactory.java:185)
>
> at
> org.springframework.beans.factory.support.AbstractBeanFactor y.getBean(AbstractBeanFactory.java:164)
>
> at
> org.springframework.beans.factory.support.ConstructorResolve r.instantiateUsingFactoryMethod(ConstructorResolver.java:287 )
>
> at
> org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.instantiateUsingFactoryMethod(AbstractAutow ireCapableBeanFactory.java:903)
>
> at
> org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.createBeanInstance(AbstractAutowireCapableB eanFactory.java:817)
>
> at
> org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFac tory.java:440)
>
> at
> org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.ja va:409)
>
> at java.security.AccessController.doPrivileged(Native Method)
> at
> org.springframework.beans.factory.support.AbstractAutowireCa pableBeanFactory.createBean(AbstractAutowireCapableBeanFacto ry.java:380)
>
> at
> org.springframework.beans.factory.support.AbstractBeanFactor y$1.getObject(AbstractBeanFactory.java:264)
>
> at
> org.springframework.beans.factory.support.DefaultSingletonBe anRegistry.getSingleton(DefaultSingletonBeanRegistry.java:22 2)
>
> at
> org.springframework.beans.factory.support.AbstractBeanFactor y.doGetBean(AbstractBeanFactory.java:261)
>
> at
> org.springframework.beans.factory.support.AbstractBeanFactor y.getBean(AbstractBeanFactory.java:185)
>
> at
> org.springframework.beans.factory.support.AbstractBeanFactor y.getBean(AbstractBeanFactory.java:164)
>
> at
> org.springframework.beans.factory.support.BeanDefinitionValu eResolver.resolveReference(BeanDefinitionValueResolver.java: 269)
>
> ... 34 more
> Caused by:
> org.springframework.beans.factory.BeanDefinitionStoreExcepti on: Factory
> method [public synchronized org.eclipse.emf.teneo.hibernate.HbDataStore
> com.person.teneo.employeeHbHelper.createRegisterDataStore(ja va.lang.String,org.hibernate.cfg.Configuration)]
> threw exception; nested exception is
> org.hibernate.PropertyNotFoundException: Could not find a setter for
> property emailAddresses in class com.person.impl.EmployeeImpl
> at
> org.springframework.beans.factory.support.SimpleInstantiatio nStrategy.instantiate(SimpleInstantiationStrategy.java:127)
>
> at
> org.springframework.beans.factory.support.ConstructorResolve r.instantiateUsingFactoryMethod(ConstructorResolver.java:435 )
>
> ... 58 more
> Caused by: org.hibernate.PropertyNotFoundException: Could not find a
> setter for property emailAddresses in class com.person.impl.EmployeeImpl
> at
> org.hibernate.property.BasicPropertyAccessor.createSetter(Ba sicPropertyAccessor.java:240)
>
> at
> org.hibernate.property.BasicPropertyAccessor.getSetter(Basic PropertyAccessor.java:233)
>
> at org.hibernate.mapping.Property.getSetter(Property.java:299)
> at
> org.hibernate.tuple.entity.PojoEntityTuplizer.buildPropertyS etter(PojoEntityTuplizer.java:272)
>
> at
> org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:149)
>
> at
> org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:76)
>
> at
> org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping . <init>(EntityEntityModeToTuplizerMapping.java:80)
>
> at
> org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:325)
> at
> org.hibernate.persister.entity.AbstractEntityPersister.<init >(AbstractEntityPersister.java:457)
>
> at
> org.hibernate.persister.entity.SingleTableEntityPersister.<init >(SingleTableEntityPersister.java:131)
>
> at
> org.hibernate.persister.PersisterFactory.createClassPersiste r(PersisterFactory.java:84)
>
> at
> org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:261)
> at
> org.hibernate.cfg.Configuration.buildSessionFactory(Configur ation.java:1327)
>
> at com.person.teneo.
> EmployeeHbSessionDataStore.buildSessionFactory(EmployeeHbSes sionDataStore.java:232)
>
> at com.person.teneo.
> EmployeeHbSessionDataStore.initialize(EmployeeHbSessionDataS tore.java:112)
> at
> com.person.teneo.EmployeeHbHelper.createRegisterDataStore(Em ployeeHbHelper.java:104)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at
> org.springframework.beans.factory.support.SimpleInstantiatio nStrategy.instantiate(SimpleInstantiationStrategy.java:115)
>
> ... 59 more
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Previous Topic:[EMF Compare] Comparing models without resources
Next Topic:newbie question - linking existing database repository to DSL
Goto Forum:
  


Current Time: Fri Mar 01 11:51:32 GMT 2024

Powered by FUDForum. Page generated in 0.02734 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top