Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Texo] No Dao class is generated for abstract class
[Texo] No Dao class is generated for abstract class [message #869158] Thu, 03 May 2012 02:35 Go to next message
Oliver Zhou is currently offline Oliver ZhouFriend
Messages: 41
Registered: February 2012
Member
Hi Martin,

Recently I noticed that dao class is not generated for abstract class.
I don't know why. To me, such dao classes should be generated because it is allowed to pass a abstract class to EntityManager.find to get all the instances of one class hierarchy.

What do you think?
Re: [Texo] No Dao class is generated for abstract class [message #869329 is a reply to message #869158] Thu, 03 May 2012 08:32 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Oliver,
Yes makes sense what you say. I changed it and am doing a new build. Will post here after I published it.

gr. Martin

On 05/03/2012 04:35 AM, Oliver Zhou wrote:
> Hi Martin,
>
> Recently I noticed that dao class is not generated for abstract class.
> I don't know why. To me, such dao classes should be generated because it is allowed to pass a abstract class to
> EntityManager.find to get all the instances of one class hierarchy.
>
> What do you think?


--

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@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [Texo] No Dao class is generated for abstract class [message #869953 is a reply to message #869329] Sat, 05 May 2012 05:23 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Oliver,
I published a new build.

gr. Martin

On 05/03/2012 10:32 AM, Martin Taal wrote:
> Hi Oliver,
> Yes makes sense what you say. I changed it and am doing a new build. Will post here after I published it.
>
> gr. Martin
>
> On 05/03/2012 04:35 AM, Oliver Zhou wrote:
>> Hi Martin,
>>
>> Recently I noticed that dao class is not generated for abstract class.
>> I don't know why. To me, such dao classes should be generated because it is allowed to pass a abstract class to
>> EntityManager.find to get all the instances of one class hierarchy.
>>
>> What do you think?
>
>


--

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@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [Texo] No Dao class is generated for abstract class [message #869990 is a reply to message #869158] Sat, 05 May 2012 15:05 Go to previous messageGo to next message
Oliver Zhou is currently offline Oliver ZhouFriend
Messages: 41
Registered: February 2012
Member
Hi Martin,

Thanks for fix, I tested the build, but it seems the problem still exists.
I debugged into the code and I found maybe the following logic in ModelEClassAnnotator.setAnnotationFeatures causes the problem:

if (!GenUtils.isDocumentRoot(eClass) && !eClass.isInterface() && !eClass.isAbstract() && !ModelUtils.isEMap(eClass)
&& GeneratorUtils.isEmptyOrNull(annotation.getDaoQualifiedClassName())) {
final EPackageModelGenAnnotation ePackageModelGenAnnotation = getEPackageModelGenAnnotation(eClass.getEPackage());
final String packagePath = ePackageModelGenAnnotation.getDaoClassesPackagePath();
annotation.setDaoQualifiedClassName(packagePath + GenConstants.DOT + annotation.getSimpleClassName()
+ getDaoPatternName(ePackageModelGenAnnotation));
} else {
// prevent dao generation
annotation.setDaoQualifiedClassName(null);
}

Could you verify it again?
Re: [Texo] No Dao class is generated for abstract class [message #870130 is a reply to message #869990] Sun, 06 May 2012 21:04 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Oliver,
Yes you are right, I am developing some other features so I don't have a working (local) build at the moment, but will
rebuild asap, will be a few days probably..

gr. Martin

On 05/05/2012 05:05 PM, Oliver Zhou wrote:
> Hi Martin,
>
> Thanks for fix, I tested the build, but it seems the problem still exists.
> I debugged into the code and I found maybe the following logic in ModelEClassAnnotator.setAnnotationFeatures causes the
> problem:
>
> if (!GenUtils.isDocumentRoot(eClass) && !eClass.isInterface() && !eClass.isAbstract() && !ModelUtils.isEMap(eClass)
> && GeneratorUtils.isEmptyOrNull(annotation.getDaoQualifiedClassName())) {
> final EPackageModelGenAnnotation ePackageModelGenAnnotation = getEPackageModelGenAnnotation(eClass.getEPackage());
> final String packagePath = ePackageModelGenAnnotation.getDaoClassesPackagePath();
> annotation.setDaoQualifiedClassName(packagePath + GenConstants.DOT + annotation.getSimpleClassName()
> + getDaoPatternName(ePackageModelGenAnnotation));
> } else {
> // prevent dao generation
> annotation.setDaoQualifiedClassName(null);
> }
>
> Could you verify it again?


--

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@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [Texo] No Dao class is generated for abstract class [message #870269 is a reply to message #870130] Mon, 07 May 2012 14:29 Go to previous messageGo to next message
Oliver Zhou is currently offline Oliver ZhouFriend
Messages: 41
Registered: February 2012
Member
No problem!
I can wait.

By the way, which exciting feature are you developing? Razz
Re: [Texo] No Dao class is generated for abstract class [message #870279 is a reply to message #870269] Mon, 07 May 2012 14:48 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Oliver,
The past weeks I added a JSON webservice layer:
http://wiki.eclipse.org/Texo/JSON_REST_Web_Services
http://martintaal.wordpress.com/2012/04/05/emf-texo-json-rest-web-service-support-connecting-your-client-to-an-emf-supporting-web-server/

I am now working on support for EMF Resources. This makes it possible to develop RCP's on top of Texo generated jpa
entities. I have developed an EMF resource which uses JPA to persist/query the database. This supports 2-tier architect
where the RCP talks directly to the database. My next step is to develop an EMF resource which talks json with a backend
web server. This combines the work I for the JSON webservice layer. So then you can have a 3-tier architecture: RCP -
[json] - webserver - database

Then after that I will develop a RIA/html5 user interface which will work with the JSON web service layer.

A smaller thing I added is that it is possible to generate the code in another project (see the texo project
properties). This will be available after I get a new build done...

gr. Martin

On 05/07/2012 04:29 PM, Oliver Zhou wrote:
> No problem!
> I can wait.
>
> By the way, which exciting feature are you developing? :p


--

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@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [Texo] No Dao class is generated for abstract class [message #870281 is a reply to message #870269] Mon, 07 May 2012 14:51 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Oliver,
The past weeks I added a JSON webservice layer:
http://wiki.eclipse.org/Texo/JSON_REST_Web_Services
http://martintaal.wordpress.com/2012/04/05/emf-texo-json-rest-web-service-support-connecting-your-client-to-an-emf-supporting-web-server/

I am now working on support for EMF Resources. This makes it possible to develop RCP's on top of Texo generated jpa
entities. I have developed an EMF resource which uses JPA to persist/query the database. This supports 2-tier architect
where the RCP talks directly to the database. My next step is to develop an EMF resource which talks json with a backend
web server. This combines the work I for the JSON webservice layer. So then you can have a 3-tier architecture: RCP -
[json] - webserver - database

Then after that I will develop a RIA/html5 user interface which will work with the JSON web service layer.

A smaller thing I added is that it is possible to generate the code in another project (see the texo project
properties). This will be available after I get a new build done...

gr. Martin

On 05/07/2012 04:29 PM, Oliver Zhou wrote:
> No problem!
> I can wait.
>
> By the way, which exciting feature are you developing? :p


--

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@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [Texo] No Dao class is generated for abstract class [message #870296 is a reply to message #870281] Mon, 07 May 2012 15:16 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Oliver,
I published a new build which should solve the dao issue you reported here.

gr. Martin

On 05/07/2012 04:51 PM, Martin Taal wrote:
> Hi Oliver,
> The past weeks I added a JSON webservice layer:
> http://wiki.eclipse.org/Texo/JSON_REST_Web_Services
> http://martintaal.wordpress.com/2012/04/05/emf-texo-json-rest-web-service-support-connecting-your-client-to-an-emf-supporting-web-server/
>
>
> I am now working on support for EMF Resources. This makes it possible to develop RCP's on top of Texo generated jpa
> entities. I have developed an EMF resource which uses JPA to persist/query the database. This supports 2-tier architect
> where the RCP talks directly to the database. My next step is to develop an EMF resource which talks json with a backend
> web server. This combines the work I for the JSON webservice layer. So then you can have a 3-tier architecture: RCP -
> [json] - webserver - database
>
> Then after that I will develop a RIA/html5 user interface which will work with the JSON web service layer.
>
> A smaller thing I added is that it is possible to generate the code in another project (see the texo project
> properties). This will be available after I get a new build done...
>
> gr. Martin
>
> On 05/07/2012 04:29 PM, Oliver Zhou wrote:
>> No problem!
>> I can wait.
>>
>> By the way, which exciting feature are you developing? :p
>
>


--

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@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Previous Topic:[EMF Facet] non respect of the API freeze
Next Topic:[TEXO] Generation by maven or Ant
Goto Forum:
  


Current Time: Sat Apr 20 03:50:59 GMT 2024

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

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

Back to the top