Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Joined strategy inheritance doesn't work #25

Open
alexeyrassokhin opened this issue Feb 15, 2017 · 1 comment
Open

Joined strategy inheritance doesn't work #25

alexeyrassokhin opened this issue Feb 15, 2017 · 1 comment

Comments

@alexeyrassokhin
Copy link

Hi!
I try to generate project with joined strategy inheritance
I just add sql code and config from documentation (http://www.jaxio.com/documentation/celerio/configuration.html)

sql:
\celerio-angular-quickstart\quickstart-conf\01-create.sql

CREATE TABLE ACCOUNT (
account_id char(32) not null,
login varchar(255) not null,
password varchar(255) not null,
email varchar(255) not null,
is_enabled bool,
civility char(2),
first_name varchar(255),
last_name varchar(255),
version smallint default 0,

constraint account_unique_1 unique (login),
constraint account_unique_2 unique (email),
primary key (account_id)

);

CREATE TABLE ADMINISTRATIVE_ACCOUNT (
account_id char(32) not null,
fax varchar(255) not null,
country varchar(255) not null,
city varchar(255),
primary key (account_id)
);

CREATE TABLE ENTERPRISE_ACCOUNT (
account_id char(32) not null,
company_name varchar(255) not null,
inception_date timestamp not null,
revenue integer not null,
dummy integer,
is_ethical bool not null,
primary key (account_id)
);

and config

<entityConfig tableName="ADMINISTRATIVE_ACCOUNT" entityName="AdminAccount">
	<inheritance parentEntityName="Account" />
	<columnConfigs>
		<!-- We do not mention all columns on purpose, we expect Celerio to add missing columns... -->
		<columnConfig columnName="fax" fieldName="faxNumber" />
	</columnConfigs>
</entityConfig>

<entityConfig tableName="ENTERPRISE_ACCOUNT">
	<inheritance parentEntityName="AdminAccount" />
	<columnConfigs>
		<!-- We do not mention all columns on purpose, we expect Celerio to add missing columns... -->
		<columnConfig columnName="revenue" fieldName="revenuePerYear" />
	</columnConfigs>
</entityConfig>
to

If I run mvn -Pdb,metadata,gen generate-sources. I get error -
[INFO] Date Mapping match for USE_CASE_1.ID1 jdbcType=TIMESTAMP => DateMapping: mappedType=M_LOCALDATETIME columnJdbcType=TIMESTAMP columnNameRegExp=null
[ERROR] In pack-angular:src\main\java\rest\EntityResource.java.e.vm method [getType] has not been set
java.lang.IllegalStateException: [AdminAccount] You probably have entity.primaryKey.var in your code, you should use entity.root.primaryKey.var
at com.jaxio.celerio.model.primarykey.NoPrimaryKey.throwException(NoPrimaryKey.java:191)
at com.jaxio.celerio.model.primarykey.NoPrimaryKey.getType(NoPrimaryKey.java:87)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.apache.velocity.runtime.parser.node.PropertyExecutor.execute(PropertyExecutor.java:142)
at org.apache.velocity.util.introspection.UberspectImpl$VelGetterImpl.invoke(UberspectImpl.java:533)
at org.apache.velocity.runtime.parser.node.ASTIdentifier.execute(ASTIdentifier.java:198)
at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:252)
at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:332)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
at org.apache.velocity.runtime.RuntimeInstance.render(RuntimeInstance.java:1277)
at org.apache.velocity.runtime.RuntimeInstance.evaluate(RuntimeInstance.java:1216)
at org.apache.velocity.runtime.RuntimeInstance.evaluate(RuntimeInstance.java:1165)
at org.apache.velocity.app.VelocityEngine.evaluate(VelocityEngine.java:219)
at com.jaxio.celerio.template.VelocityGenerator.evaluate(VelocityGenerator.java:53)
at com.jaxio.celerio.template.PreviousEngine.processDynamicFile(PreviousEngine.java:352)
at com.jaxio.celerio.template.TemplateExecution.write(TemplateExecution.java:597)
at com.jaxio.celerio.template.TemplateEngine.produce(TemplateEngine.java:273)
at com.jaxio.celerio.template.TemplateEngine.produceEntities(TemplateEngine.java:227)
at com.jaxio.celerio.template.TemplateEngine.produce(TemplateEngine.java:164)
at com.jaxio.celerio.main.CelerioProducer.produce(CelerioProducer.java:67)
at com.jaxio.celerio.main.CelerioProducer.produce(CelerioProducer.java:60)
at com.jaxio.celerio.maven.plugin.celerio.GenerateMojo.process(GenerateMojo.java:220)
at com.jaxio.celerio.maven.plugin.celerio.GenerateMojo.execute(GenerateMojo.java:201)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[ERROR] Invocation of method 'getType' in class com.jaxio.celerio.model.primarykey.NoPrimaryKey threw exception java.lang.IllegalStateException: [AdminAccount] You probably have entity.primaryKey.var in your code, you should use entity.root.primaryKey.var at src\main\java\rest\EntityResource.java.e.vm[line 112, column 87]

@nromanetti
Copy link
Member

Celerio supports inheritance but currently the angular templates do not. I flag it as enhancement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants