Acceleo and Hibernate - acceleo

Does Acceleo generate Hibernate or is it UML2 to Java EE that does that? if Acceleo is doing it, then can someone please guide me to a sample example for it that generates Hibernate.
Also I want to know if either one of Acceleo or UML2 to Java EE generate Spring?

Acceleo is a generic code generator, you can create an Acceleo based generator to generate anything from assembly to Ruby if you want. You can find online some Acceleo generators that I have created in order to generate Java from UML or Scala from a custom Scala metamodel. If you want to generate Java EE, you can create a Java EE generator by using the UML to Java generator as an inspiration.
Currently we are working on the new version of Obeo Designer for IS which contains Acceleo 3 based generator to generate Spring/Struts/Hibernate from our three custom metamodels (entities, cinematic and soa). OD4IS is a commercial product built on top of Acceleo (which is free and open source). You can find more about OD4IS on our website. I don't have the release date for this new version of OD4IS but it should be available in the upcoming weeks. In the mean time, you can create your own generators or give the previous version of OD4IS a try (an evaluation version is available online). It should be noted that this previous version is based on Acceleo 2.x.
Disclaimer: I am working at Obeo as a developer on both Acceleo and OD4IS

Related

What's the best way to create a Java EE project (maven+git) using Spring tool suite?

I see that there are many kinds of project you can create with Spring Tool Suite.
I'm wondering what's the best choice if I should create a Java Enterprise Edition project, integrated with maven and git.
Is there a specific project to select, in order to have straight away all the environment ready?
From the Spring perspective, I would strongly recommend to start with a Spring Boot project and go from there, using the new Spring Tools 4 (or the Spring Tool Suite version 4). It provides wizards to get started quite easily.
If you don't want to use Spring Boot, but something else from the Java Enterprise Edition standard in combination with Spring, I would recommend to use the Spring Tools 3 distribution (comes with the full Java EE tooling from Eclipse pre-installed) or install the necessary parts from Eclipse into a Spring Tools 4 installation. Which parts you need highly depends on which parts of the Java Enterprise Edition spec you would like to use - the general term "Java Enterprise Edition" is very broad and it is hard to give any advice without knowing which parts you would like to use or what you would like to accomplish.

How to enable spring support in IntelliJ Community Edition 2016.1.3

I have very good pure Java basic knowledge. As long as there are no XML config and no project management tools involved, I am very good.
The things that really confused me are the project management tools, e.g.: Maven, Gradle.
I am learning Spring, and it is so confusing to me since it involves many XML files and there is no clear explanation for it.
I am learning Spring from this set of video tutorials, Lecture 6
Spring "Hello World".
I couldn't get a Spring hello world done because it requires a xxxxx.xml file to config the beans (Java object). To generate the XML files, I need to generate an XML file using a plugin on IntelliJ 2016.
The question is I can't find the plugin to generate a XML file for the bean by following this official tutorial. There is no such plugin called " Spring Support".
What should I do to generate the beans.xml? (The file to manage beans for Spring)
You can't enable Spring support with IntelliJ community Edition, it only available with paying version (Ultimate).
However, you can create the .xml file manually and CE version also supports it (a little bit).
To working with Spring or J2EE, you should get familiar with build tools like Maven, Gradle (or Ant in some special case). The concept is simple and you can get it easily from the official website (https://maven.apache.org/ - http://gradle.org/).
For Spring, if you are not familiar with creating a .xml file, you can use Java configuration instead or move to use Spring-boot to forget this configuration file (almost).
However, at first, I think you should get the basic concept of Spring and try to work well with .xml files configure. It'll be helpful in the future when you work with it deeply.
Let's take things one by one:
Your problem understanding builds management tools like maven and gradle. Try these links for tutorials: Maven in 5 Minutes, gradle is very advance build automation tool with continuous Integration features, you can find a good comparison between gradle and maven here.
If you are confused about spring to try this book: Spring in Action 3rd Edition (4th Edition is also available, I recommend 3rd edition as you will be able to link XML to annotations.)
You do not need any tool to generate XML files. Copy a sample spring configuration file from the internet, remove unwanted elements and write your own beans.
The Spring support plugin is a feature of IntelliJ IDEA Ultimate, which is a commercial IDE. It's not available in the free Community Edition.
You don't need any plugin to generate the beans.xml file; you can write it manually in the source code editor.
For Spring support, did you try "Spring Assistant" plugin ?
https://plugins.jetbrains.com/plugin/10229-spring-assistant
Good part it is it has active development.
Edit on Aug 21, 2020:
Seems like this plugin has no more active development. Its last release was in 2018 April.
No need to worry. We sill have some good news :-)
Its Github repository is here. We can clone the repo and make necessary changes what ever we specifically need.
I know you are asking about IntelliJ Idea but as it is a commercial tool, you should pay to let you use its plugins. Another way is using "Spring Tools for Eclipse" which is a great environment to develop Spring applications. But you need to be familiar with eclipse.
It can be downloaded from:
Spring Tools 4 for Eclipse

Adopt Spring Roo and JBoss Forge

Roo is tied to Spring framework and Maven is inherent, while Forge is closely related to Java EE/JBoss-AS and Maven becomes optional.
Can we use either of them to scaffold something independent of programming models, namely Spring framework or Java EE/CDI herewith?
Any pointers about Forge and Maven integration? Quick google leads to no useful links yet.
Since 2 years I use Telosys Tools (instead of ROO) for Java applications scaffolding
because this code generator is simple and independent of any kind of environment
(it's possible to generate anything : Java, HTML, Python, etc...)
Some predefined templates are available on GitHub, if they don't match your needs you can create your own templates for your specific targets
cf tutorials : https://sites.google.com/site/telosystutorial/
Telosys ( http://www.telosys.org/ ) is a good tool to bootstrap a project. The scaffolding is possible from a database or from a lightweight text model.
The code generation is based on Velocity templates so you can customize existing templates or create your own templates.
Everything is free and Open Source (generator and templates).
There is nothing that ties Forge to JBoss AS or really Java EE for that matter. At it's core Forge is a shell for generating resources. The available plugins tend to be Java EE focused, but they don't have to be.
Have a look at the Forge website. There is plenty of information on it there. Also JBoss Tools has nice integration with it if you use eclipse too.

Which version of acceleo is been used in screencasts?

Can anyone please tell me which version of acceleo is been used in screencasts of acceleo website? Because currently I am using acceleo 2.7 and I am trying to do the same thing but I don't get the expected results!
Edit:
I am new to Acceleo and I was trying to learn from the tutorials, I downloaded topcased integrated into eclipse helios 'Topcased-RCP-win32-4.3.0.zip' from this link
http://www.topcased.org/index.php?idd_projet_pere=52&Itemid=60
and it is associated with acceleo 2.7, apparently the topcased is working because I can create the diagrams with no problem but when I create a new module launcher for hibernate and launch it, according to this screen cast
http://acceleo.org/screencast.phpwidth=1024&height=788&swf=modules/pages/jee/images/screencast/GenerationBDAcceleo&lang=en
it should generate the hbm.xml file and the sql files but the only thing I get is a 'src' folder and some other subfolders in it has been generated with no code!
Daniel,
Which screencasts are you talking about? The official Acceleo website is now hosted on Eclipse. Are you talking about the screencasts that can be found on its documentation page? Or about those that can be located through the Eclipse wiki? These are all for the current version of Acceleo, i.e the versions 3.*.
However if you are talking about the acceleo.org website, as you can see from its homepage, it is a website for the maintenance release (the versions 2.*). If you are using Acceleo 2.7, this is the website where you can locate accurate screencasts. We do not encourage users to start using Acceleo with this version though, and we recommend using the Acceleo 3.x stream instead.

I don't have module launcher tag in Acceleo in Eclipse

I am using Eclipse version 3.6.2, and I have installed Acceleo plugin for it but according to the instructions and tutorials I have read, I should be having module launcher under Acceleo tag in 'New' menu but I don't have it. I tried to install the modules from module update link in acceleo, however during the installing the modules an error occurs showing this message
*Cannot complete the install because one or more required items could not be found.
Software being installed: UML 2.1 to Java generator 1.0.0.201102031027 (org.acceleo.module.pim.uml21.gen.java_feature.feature.group 1.0.0.201102031027)
Missing requirement: UML 2.1 to Java generator 1.0.0.201102031027 (org.acceleo.module.pim.uml21.gen.java_feature.feature.group 1.0.0.201102031027) requires 'fr.obeo.acceleo.gen 0.0.0' but it could not be found*
Can anyone please tell me, why I am getting this error or why I don't have module launcher?
Many thanks in advance.
I assume that you have installed the latest version of Acceleo that has been release last month, Acceleo 3.1 if that's not the case, you can install it with the Acceleo 3.1.x update site: http://download.eclipse.org/modeling/m2t/acceleo/updates/releases/3.1
You can find the Acceleo wizards under the new menu only if you are using the Acceleo perspective (Window -> Open perspective -> Other) otherwise you have to use the regular menu for all wizards (File -> New -> Other).
The Acceleo generator that you are installing is the UML to Java module for Acceleo 2.x. Acceleo 2.x and Acceleo 3.x are not compatible and therefore you cannot install this module unless you install the old version of Acceleo (its plugin are named fr.obeo.acceleo.* instead of org.eclipse.acceleo.*).
But, this generator is currently being migrated to Acceleo 3.1 and if you need it, you can grab it quite easily. This generator is licenced under the open source licence named EPL and its source code is available on github.com. If you want to install it, go to Github.com and download the source code (by using git, or the download button) then go in the root folder (the one visible in the link with the "plugins", "tests" subfolders) and then you can use maven 3 (maven 2 is not enough to build an Acceleo generator) to build the generator by typing "mvn clean package".
Maven will download half of the internet the first time you'll try to build it and in the end you will have an update site for this module in the "rootfolder/updatesite/org.obeonetwork.pim.uml2.gen.java.updatesite/target/repository" folder. You just have to install this UML to Java generator by adding this as an "local" update site. Once it's done, you can restart your Eclipse and then a new menu named "Acceleo model to text" will be available once you right click on a *.uml file in your workspace. With this menu, you'll be able to generate Java from this uml model.
The uml model in question need to have been created with a project compatible with EMF like the uml project of the Eclipse foundation (org.eclipse.uml.uml2). You can find an example of UML model in the Acceleo 3 examples (File -> New -> Examples).
If you don't need to build the generator, you can simply use its source code after having download it from github. You can use it, test it, fork it or even contribute to it as you want. And if you find a bug in this generator, you can report the problem on the Acceleo forum in the Eclipse Foundation (please use an [acceleo] tag in your title on the Eclipse forum) or on stack overflow.

Resources