Created
March 4, 2015 17:17
-
-
Save agoncal/563a99cd3b2ee7fb196e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class JPANewEmbeddableCommand extends AbstractJPACommand<JavaClassSource> | |
| { | |
| @Inject | |
| private PersistenceOperations persistenceOperations; | |
| @Override | |
| public Metadata getMetadata(UIContext context) | |
| { | |
| return Metadata.from(super.getMetadata(context), getClass()) | |
| .name("JPA: New Embeddable") | |
| .description("Create a new JPA Embeddable"); | |
| } | |
| @Override | |
| protected String getType() | |
| { | |
| return "JPA Embeddable"; | |
| } | |
| @Override | |
| protected Class<JavaClassSource> getSourceType() | |
| { | |
| return JavaClassSource.class; | |
| } | |
| @Override | |
| public JavaClassSource decorateSource(UIExecutionContext context, Project project, JavaClassSource source) | |
| throws Exception | |
| { | |
| JavaResource javaResource = persistenceOperations.newEmbeddableEntity(project, getNamed().getValue(), | |
| getTargetPackage().getValue()); | |
| return javaResource.getJavaType(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment