Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Sapphire » Persisting the generated implemented class in Sapphire
Persisting the generated implemented class in Sapphire [message #760583] Sat, 03 December 2011 07:17 Go to next message
St Clair Clarke is currently offline St Clair ClarkeFriend
Messages: 118
Registered: March 2010
Senior Member
Hello,
Say I have com.epimss.reg.data.demography.IName, containing metadata for Sapphire. The @GenerateImpl is used to annotate IName.

I would like to persist the results of Name (generated) to my datastore. I note that this file is placed by default into a new source directory named .apt_generated (when Project properties enable annotation is enabled - com.epimss.reg.data.demography.internal.Name.

1. Do I persist com.epimss.reg.data.demography.internal.Name to my datastore?
2. Do I update com.epimss.reg.data.demography.internal.Name from the datastore?

I am just wondering how datastore persistence is factored ins Sapphire.

Thanks

Re: Persisting the generated implemented class in Sapphire [message #760637 is a reply to message #760583] Sat, 03 December 2011 18:25 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 1077
Registered: July 2009
Senior Member
Could you be more specific regarding what you mean by datastore persistence? What are you trying to persist to?

In Sapphire, persistence is handled through a layer called resource (see Resource class and concrete implementations like XmlResource). When you instantiate a Sapphire model element through type's instantiate method, you pass in an instance of the resource. The model element will read/write through the resource. Sapphire currently provides two concrete resource implementations: for xml and for in memory. Adopters can write their own resources, although that is a fairly advanced task and I would not recommend it for someone just starting with the framework.

- Konstantin
Re: Persisting the generated implemented class in Sapphire [message #760639 is a reply to message #760637] Sat, 03 December 2011 18:54 Go to previous messageGo to next message
St Clair Clarke is currently offline St Clair ClarkeFriend
Messages: 118
Registered: March 2010
Senior Member
Hello,
Thanks for the reply.

Let me explain. I might be thinking conventionally now which is somewhat different from Sapphire's approach.

Sapphire will be my front-end and a database eg relational or object-database will be my backend. When changes are made to my front-end I would then have to store those changes to the database as currently done with current UIs.

Currently, it is the JavaBean that I would store in the database with all its fields/properties. This is the JavaBean that Sapphire generates.

So, how/and/or what do I now store to my database after changes have been made by Sapphire UI?

I hope this helps.

Thanks
Re: Persisting the generated implemented class in Sapphire [message #760667 is a reply to message #760639] Sun, 04 December 2011 04:00 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 1077
Registered: July 2009
Senior Member
The model classes generated by Sapphire resemble Java Bean convention in spirit, but do not conform to it. Frameworks (like JPA) that work with Java Beans will not work with Sapphire models.

The best way to use Sapphire and JPA together is to write a class for every model element that implements Sapphire's Resource interface and serves as the Java Bean for that element's data. Then you'd provide that bean/resource when instantiating the model element.

There has been some requests to better support JPA in Sapphire. When we get to this, we would likely take the route of implementing a code generator that is able to produce JPA bean/resource classes.

- Konstantin
Re: Persisting the generated implemented class in Sapphire [message #760673 is a reply to message #760667] Sun, 04 December 2011 05:04 Go to previous messageGo to next message
St Clair Clarke is currently offline St Clair ClarkeFriend
Messages: 118
Registered: March 2010
Senior Member
Thanks,

I currently persist my JavaBeans using JDO to an object database (ObjectDB) or db4o. I'm quite enthusistic about Sapphire, but this revelation is somewhat disconcerting.

Whenever your JPA generator matures, please consider those of us who use JDO.

Could you please demonstrate what you advise with some small snippets?

Thanks

NB: To what database can one currently persist Sapphire's model?
Re: Persisting the generated implemented class in Sapphire [message #760900 is a reply to message #760673] Mon, 05 December 2011 14:38 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 1077
Registered: July 2009
Senior Member
Quote:
Could you please demonstrate what you advise with some small snippets?


We don't have a ready-made sample for this and it is more than could be put together quickly for a forum post. Take a look at Sapphire's Resource API and refer to XmlResource for a concrete implementation example.

Quote:
Whenever your JPA generator matures, please consider those of us who use JDO.


We are fundamentally limited in what we can support with existing people contributing to the project. Large expansions in scope (such as supporting JPA or JDO) will likely require an interested party to come forward willing to contribute to the implementation. A bit ago, I thought we had such contributor lined up for JPA support, but he walked away before the task got started.

Quote:
NB: To what database can one currently persist Sapphire's model?


Sapphire natively implements support for in-memory persistence and for XML persistence. Everything else would need to be done through a custom Resource implementation. As such, Sapphire doesn't natively support persistence to any database, but an adopter could implement it for any database they choose.

- Konstantin

[Updated on: Mon, 05 December 2011 14:39]

Report message to a moderator

Re: Persisting the generated implemented class in Sapphire [message #760982 is a reply to message #760900] Mon, 05 December 2011 18:46 Go to previous messageGo to next message
St Clair Clarke is currently offline St Clair ClarkeFriend
Messages: 118
Registered: March 2010
Senior Member
Hello Konstatin,

Quote:
Sapphire natively implements support for in-memory persistence and for XML persistence. Everything else would need to be done through a custom Resource implementation. As such, Sapphire doesn't natively support persistence to any database, but an adopter could implement it for any database they choose.


It would seem that Sapphire currently had quite a limited user base in mind when its main form of persistence is XML. Or is it that Sapphire is simply attempting to garner a niche market - XML persistence to be specific.

I would think that currently the majority of database persistence is still related to relational databases, yet there is no obvious mechanism for that.

Please point me to Sapphire's scope for me to take a closer look as to what the framework hopes to accomplish.

Currently it seems that the UI aspect of the framework is brilliant, but what can be done with this UI out-of-the-box is quite limited.

I would not want to simply change to XML persistence just because Sapphire supports it.

Thanks

[Updated on: Mon, 05 December 2011 18:53]

Report message to a moderator

Re: Persisting the generated implemented class in Sapphire [message #761122 is a reply to message #760982] Mon, 05 December 2011 23:31 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 1077
Registered: July 2009
Senior Member
Here is the project proposal document, which covers scope:

http://www.eclipse.org/proposals/sapphire/

Sapphire's scope is wide open, but the available resources are quite limited. Work on Sapphire is currently primarily funded by Oracle with some small contributions in recent months from other companies. Oracle funds this project as a way to facilitate easier development of features for Eclipse IDE (both in open source and in commercial extensions). The two primary serialization usecases in that context are XML serialization and no serialization required (think dialogs and wizards). Developing JPA or JDO integration is in scope of Sapphire, but outside the scope of my funding. I could justify doing a bit of work towards enabling this, but I cannot staff this entirely. The ideal solution would be for a partner organization to come along that is interested in enabling database integration with Sapphire and is willing to fund that work. It is within the scope of my funding to facilitate contributions of others (review patches, etc.) even if said functionality is outside of what I could fund the development of directly.

Hope that clarifies the situation.

Thanks,

- Konstantin
Re: Persisting the generated implemented class in Sapphire [message #761199 is a reply to message #761122] Tue, 06 December 2011 04:30 Go to previous messageGo to next message
St Clair Clarke is currently offline St Clair ClarkeFriend
Messages: 118
Registered: March 2010
Senior Member
Thanks Konstantin,

Quote:
Developing JPA or JDO integration is in scope of Sapphire, but outside the scope of my funding


What is a rough estimate of the funding need to develop the JDO-persistence aspect of Sapphire? You could please send some details to my email address which I think you should be able to access - st_clair at flowja.com
Re: Persisting the generated implemented class in Sapphire [message #761299 is a reply to message #761199] Tue, 06 December 2011 08:58 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 1077
Registered: July 2009
Senior Member
I imagine that it is a task somewhere from 2 week to 2 month in size, depending on developer.

- Konstantin
Re: Persisting the generated implemented class in Sapphire [message #761506 is a reply to message #761299] Tue, 06 December 2011 14:59 Go to previous messageGo to next message
St Clair Clarke is currently offline St Clair ClarkeFriend
Messages: 118
Registered: March 2010
Senior Member
Thanks Konstantin,
Quote:
I imagine that it is a task somewhere from 2 week to 2 month in size, depending on developer.


Could you please give an estimate for the 2 weeks to 2 month in terms of money ($US)?

Thanks

[Updated on: Tue, 06 December 2011 14:59]

Report message to a moderator

Re: Persisting the generated implemented class in Sapphire [message #761529 is a reply to message #761506] Tue, 06 December 2011 15:46 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 1077
Registered: July 2009
Senior Member
Are you asking me to give you a bid for this work? Sorry for a misunderstanding. I am not a contractor able to take on jobs like this and I work for a division of Oracle that does product development (so no outside jobs). If you are contemplating financially supporting this feature, there are companies that specialize in contracting for this type of work. One such company that you can turn to is Itemis.

http://www.itemis.com/
http://www.eclipse.org/membership/showMember.php?member_id=817

- Konstantin
Re: Persisting the generated implemented class in Sapphire [message #761578 is a reply to message #761529] Tue, 06 December 2011 17:22 Go to previous message
St Clair Clarke is currently offline St Clair ClarkeFriend
Messages: 118
Registered: March 2010
Senior Member
Thanks.
Previous Topic:Determining whether an element contains a certain property
Next Topic:XML Self closing tags
Goto Forum:
  


Current Time: Fri Apr 26 17:25:01 GMT 2024

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

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

Back to the top