Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
My project is building a Java web application on top of the AllegroGraph RDF store. I would like to find a good solution to map between the triples that come out of the store and our domain objects. I have looked into Topaz, an Object/Triple mapping API being developed in the spirit of Hibernate. The trouble is that they don't currently have a connector to AllegroGraph.
Has anyone come up with a good scheme for Object/Triple mapping in Java, in light of the limited API support out there? One issue that makes this question more difficult is that unlike SQL, the SPARQL standard only supports read operations, so writes are done via the RDF store's proprietary API, and I'd really like to abstract away those details in our application.
For the OO-RDF mapping in general, you might want to have a look at:
OpenRDF Elmo http://www.openrdf.org/ (works only with sesame but designed to be extensible and extending sesame to work on top of allegrograph(look at the sail (Storage and inference Layer) architecture)
Sommer https://sommer.dev.java.net/ with some explanation of how it works here http://blogs.oracle.com/bblfish/
There is also RDFReactor http://semanticweb.org/wiki/RDFReactor which works on top of RDF2go. RDF2go is an abstraction layer with implementation for jena or sesame. Again nothing about AllegroGraph so you would need an implementation of the binding.
I don't know for RDFReactor but i know that sommer and elmo are both based on annotation of POJO and allows the updates via direct triple-based-API or the queries using SPARQL.
As for AllegroGraph itself, I'm not aware of anything specific but they seems to support Sesame and to interface with it, so you might be able to work this way.
I like the redland RDF libraries. RDF parsing, storage, SPARQL/RDQL queries, fairly complete, but modular enough to use only what you want. They have Java bindings, but I have only used the C API (and also wrote a (partial) Lua binding)
One issue that makes this question
more difficult is that unlike SQL, the
SPARQL standard only supports read
operations, so writes are done via the
RDF store's proprietary API, and I'd
really like to abstract away those
details in our application.details in our application.
AllegroGraph supports the open-source Jena API, through which you can perform write operations. It's cool; it works. Maybe that's abstraction enough for your purposes.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I have been vetting the process of Code Generators online. I started my search with a promising but not popular Eclipse plugin called FastCode (http://www.3pintech.com/products/fast-code/).
It had a higher learning curve with a tradeoff for flexibility. That was find for me because a lot of our application follows a certain standard that I would need to maintain with the generated code. Unfortunately it was very buggy and I think it may be a dead project.
On to SpringFuse. This looked promising, but I have a few problem with it.
1) We are far into our project development lifecycle and I only need to use it for a subset of new tables in our MYSql database. Springfuse seems to take a "let us generate your entire application" approach.
2) We don't use Hibernate and SpringFuse seems to be tied into this
3) It doesn't seem to be that configurable
What I would like to do is start with a database table, and from there generate a corresponding POJO, DAO for CRUD operations, Service Layer to call the DAO and a Unit test for testing each layer. We have a standard pattern for creating our DAO layer that I will be using.
I am considering using Perl or maybe another templating system to do this but that will involve a significant amount of coding on my part. I was wondering if the SO community knows of any good technologies to use here.
I actually think an online sevice would be awesome here, something like the awesome JSON2POJO, but I don't think it exists.
After some research, the solution that worked best for me was to use the FreeMarker Java Template Engine and write my own code generation system. Using regular expressions to parse our database file and converting some of our existing code into FreeMarker templates only took a couple of days and yielded a system that is going to save us a lot of time.
I recommend this approach to users who are in a similar spot for highly customized Enterprise Applications. Most of the rendered code is not fit for primetime, but the base boilerplate code I'm generating results in huge time-savings.
FreeMarker's templating system is very similar to other technologies like JSTL and it throws very descriptive error messages so designing the templates was very simple.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I'm using Berkeley DB Java edition, via the DPL interface.
I want to ask if someone knows about any GUI library that could make it easy to browse the data saved in the database.
I know that BDB documentation says that the metadata about the stored entities is not saved in any place and therefore only the person who have written the data can know what are the types of the classes that would be returned from there. That's why I'm searching for a library (not a complete program) that would be included to the main project and so it would know the types of my classes and would be able to show the data correctly.
p.s. I've found this bdb-browser but it seems like a dead project.
Update:
So far I've found a GUI that shows the statistics gathered for the BDB via the JMX. Here is how to use it: http://www.oracle.com/technology/documentation/berkeley-db/je/jconsole/JConsole-plugin.html
Still searching for data browser...
You could try DbVisualizer.
DbVisualizer doesn't directly support the Berkeley DB, but does provide JDBC drivers for many databases,
You can use Execute Query to connect Berkeley DB. Its is a free software. You can get the distribution from http://executequery.org
Here is an extremely simple browser. Needs to be compiled though.
https://github.com/ferruccio/bdbvu
I did a quick search and didn't find anything.
I don't think you're going to have a lot of luck looking for a data browser, because the format of the value in each database entry is going to be variable. For example, it might be primitive data, data written out by the default Java serialization, or a custom format for an instance of a class which implements Externalizable.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I am making some small "business intelligence" applications/tools that need to talk to other systems. Primarily accounting systems that believe that databases are an integration layer (or are too lazy to provide an api).
What's the easiest way of getting specific data out of a third party database and into my Java objects?
Notes:
(I am now bolding the points below that have not been directly answered)
This is absolutely a read only situation. I would prefer a solution that cannot write.
Depending on speed and/or aggregation requirements, I may want/need to store these records at a future point. (This may or may not impact on solutions like hibernate which would have difficulty reading from one db and writing to another)
The first cut would be a very select partial object population (I have generated my objects from an xml schema, and the database will only need to supply 30% of the possible fields etc)
The first db integration target is (Visual?)FoxPro - hence point 2.
I am currently developing primarily in Java, but expect that to change to scala soonish (can LINQ help here?)
The standard of mapping db schema to objects (and vice versa) is the Java Persistence API. There are several implementation like Hibernate and EclipseLink (and others). I can't tell for all of them, but hibernate an eclipse plugin called hibernate tools, which can generate Java classes from the schema. You can find instructions here
JPA has its own query language called JPQL, Hibernate supports an extended version of it called HQL. Both looks like SQL, applied to objects.
I suggest you take a look at ScalaQuery, if you are doing Scala code.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I'd like to have a ActiveRecord implementation in Java and before crafting my own, I'd like to know if there is an open source implementation of it.
I am aware of other successful java OR maping tools like Hibernate, Castor, etc... and that is not what i want, i want a ActiveRecord like in RoR:
RoR ActiveRecord
.NET Castle ActiveRecord
Anyone?
I released this ActiveJDBC project: http://javalite.io/activejdbc
This is an implementation of ActiveRecord in Java
After "Googling" for a answer I've found the project arjava. It implements the Active Record pattern kind of similar to the Ruby way.
Hibernate is an ORM framework in Java and based on JPA specifications. JPA (Java Persistent API) internally implements ActiveRecord Pattern at number of places. But overall JPA is based on bit complex pattern called as DataMapper.
You can refer to this Active Record Pattern paper for comparison between Rails ActiveRecord and Hibernate
I discover the scooter framework which is based on AR, with built-in Ajax functions and pure Java and Jsp and code generator, it's wonderful of simplicity and efficacity !!
You could also consider using ActiveRecord-JDBC running on JRuby:
http://wiki.jruby.org/wiki/ActiveRecord-JDBC
I haven't done that myself, but I have had great success in using ActiveRecord's Migrations to manage schema migrations in a Hibernate based application.
Check out ActiveObjects, a more Rails-esque ActiveRecord then the other mappers: https://activeobjects.dev.java.net/
There is a nice implementation in the play framework using JPA.
Maybe it can be used solo...
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I'm building an application using a JPA object model, and creating several Data Access Objects to interact with that model. I'm finding that I'm repeating a lot of code (essentially CRUD) between different Data Access Objects. The only thing that differs are the targeted JPA classes.
I was wondering if anybody knows of an abstraction library that could be used with any JPA model and would produce the necessary DAOs (or CRUD operations). Supporting of course all the One-to-one, One-to-many, Many-to-one and Many-to-many relations.
Thanks
PS - Do you know of such a library even if it is not for JPA models?
You could use generics and code your DAO's to interfaces. The Spring Documentation explains this.
I suggest you take a look at this article: http://www.ibm.com/developerworks/java/library/j-genericdao.html.
It explains a pattern for implementing an generic DAO with Hibernate and Spring AOP, but could be easily adapted to JPA named queries (and AspectJ-based AOP, if you don't want to use Spring).
Being based on the Java Reflection API, the concept is very extensible. I've for example seen implementations using annotated method arguments as named parameters.
I'm looking for a generic DAO library as well. Here's what I've found.
Libraries:
http://code.google.com/p/hibernate-generic-dao/ (I'll probably use this one, although it's not being maintained anymore)
http://code.google.com/p/generic-dao/
http://code.google.com/p/genericdao/
Articles:
http://www.javaworld.com/community/node/8239
http://www.codeproject.com/Articles/251166/The-Generic-DAO-pattern-in-Java-with-Spring-3-and
http://www.ibm.com/developerworks/java/library/j-genericdao/index.html
You could have a look on http//www.adichatz.org if you want to quickly develop your application using JPA data model targeted to an Eclipse RCP application. At this moment it works only with Jboss or in Java SE mode.
DAO's with JPA or Hibernate make no sense. A DAO exists to hide other code from the complexity of the database. Which is what JPA and Hibernate do, quite well.
So, why add a DAO to a DAO layer?