mongodb statistics
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
#Command
|
||||
@Extends(Command)
|
||||
CommandListStatistics {
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
#Command
|
||||
@Extends(Command)
|
||||
CommandListStatisticsResponse {
|
||||
movies: StatisticsFilm[] {};
|
||||
shows: StatisticsVorstellung[] {};
|
||||
}
|
||||
8
TelosysTools/models/InfiniMotion/StatisticsFilm.entity
Normal file
8
TelosysTools/models/InfiniMotion/StatisticsFilm.entity
Normal file
@@ -0,0 +1,8 @@
|
||||
// Entity StatisticsFilm
|
||||
|
||||
#Statistics
|
||||
StatisticsFilm {
|
||||
movie: Film {};
|
||||
tickets: Eintrittskarte[] {};
|
||||
earnings: int {};
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// Entity StatisticsVorstellung
|
||||
|
||||
#Statistics
|
||||
StatisticsVorstellung {
|
||||
show: Vorstellung {};
|
||||
tickets: Eintrittskarte[] {};
|
||||
earnings: int {};
|
||||
}
|
||||
@@ -22,7 +22,7 @@ ENTITY_PKG=de.infinimotion.model.bean
|
||||
ProjectVariable.MAVEN_ARTIFACT_ID=model
|
||||
ProjectVariable.MAVEN_GROUP_ID=de.infinimotion
|
||||
ProjectVariable.PROJECT_NAME=infinimodel
|
||||
ProjectVariable.PROJECT_VERSION=0.0.89
|
||||
ProjectVariable.PROJECT_VERSION=0.0.101
|
||||
ProjectVariable.REST_SERVER_PORT=3000
|
||||
ProjectVariable.REST_API_ROOT=/api/v1
|
||||
ProjectVariable.REST_URL_ROOT=http://localhost:3000
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
## --------------------------------------------------
|
||||
#if ( !($entity.hasTag("BaseModel") || $entity.hasTag("Omdb")) )
|
||||
#if ( !($entity.hasTag("BaseModel") || $entity.hasTag("Omdb") || $entity.hasTag("Statistics")) )
|
||||
#cancel("Not a Base or Omdb Model")
|
||||
#end
|
||||
## --------------------------------------------------
|
||||
@@ -12,6 +12,7 @@ package ${target.javaPackageFromFolder("backend/${SRC}")};
|
||||
|
||||
import java.io.Serializable;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
#foreach( $import in $java.imports($entity) )
|
||||
import $import;
|
||||
@@ -30,6 +31,7 @@ import $import;
|
||||
* @author Telosys Tools Generator
|
||||
*
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@lombok.EqualsAndHashCode
|
||||
@JsonFormat(with = JsonFormat.Feature.ACCEPT_CASE_INSENSITIVE_PROPERTIES)
|
||||
public class ${entity.name} implements Serializable {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
## --------------------------------------------------
|
||||
#if ( !($entity.hasTag("BaseModel") || $entity.hasTag("Omdb")) )
|
||||
#if ( !($entity.hasTag("BaseModel") || $entity.hasTag("Omdb") || $entity.hasTag("Statistics")) )
|
||||
#cancel("Not a Base or Omdb Model")
|
||||
#end
|
||||
## --------------------------------------------------
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#foreach( $entity in $model.allEntities )
|
||||
#if ( $entity.hasTag("BaseModel") || $entity.hasTag("Omdb") )
|
||||
#if ( $entity.hasTag("BaseModel") || $entity.hasTag("Omdb") || $entity.hasTag("Statistics") )
|
||||
import $entity.name from "./${entity.name}";
|
||||
#end
|
||||
#end
|
||||
|
||||
export type {
|
||||
#foreach( $entity in $model.allEntities )
|
||||
#if ( $entity.hasTag("BaseModel") || $entity.hasTag("Omdb") )
|
||||
#if ( $entity.hasTag("BaseModel") || $entity.hasTag("Omdb") || $entity.hasTag("Statistics") )
|
||||
$entity.name,
|
||||
#end
|
||||
#end
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
*/
|
||||
package ${target.javaPackageFromFolder("${component}/${SRC}")};
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import java.io.Serializable;
|
||||
|
||||
#foreach( $import in $java.imports($entity) )
|
||||
@@ -29,6 +30,7 @@ import $import;
|
||||
* @author Telosys Tools Generator
|
||||
*
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@lombok.EqualsAndHashCode#if( $entity.hasSuperClass() )(callSuper=true)#else #end
|
||||
public#if( $entity.isAbstract() ) abstract#end class ${entity.name}#if( $entity.hasSuperClass() ) extends $entity.superClass#end implements Serializable {
|
||||
|
||||
@@ -109,6 +111,7 @@ public#if( $entity.isAbstract() ) abstract#end class ${entity.name}#if( $entity.
|
||||
= new com.fasterxml.jackson.databind.ObjectMapper()
|
||||
.setVisibility(com.fasterxml.jackson.annotation.PropertyAccessor.FIELD, com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.ANY)
|
||||
.configure(com.fasterxml.jackson.databind.SerializationFeature.FAIL_ON_EMPTY_BEANS, false)
|
||||
.configure(com.fasterxml.jackson.databind.DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
|
||||
.findAndRegisterModules();
|
||||
|
||||
public abstract CommandWrapper serialize() throws java.io.IOException;
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
*/
|
||||
package ${target.javaPackageFromFolder("${component}/${SRC}")};
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
@@ -18,6 +19,7 @@ import java.io.Serializable;
|
||||
* @author Telosys Tools Generator
|
||||
*
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@lombok.EqualsAndHashCode(callSuper=true)
|
||||
public class Command${commandType}${entity.name}Response extends Command implements Serializable {
|
||||
|
||||
|
||||
@@ -47,6 +47,7 @@ package ${target.javaPackageFromFolder("persistence/${SRC}")};
|
||||
$generator.generate($target.entityName , "${jpaEntityIdClass}.java", $target.folder, "persistence/persistence_entity_id_java.vm" )
|
||||
#end
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import java.io.Serializable;
|
||||
#foreach( $import in $java.imports($entity) )
|
||||
import $import;
|
||||
@@ -67,6 +68,7 @@ $jpa.entityAnnotations(0, $entity)
|
||||
#if ( $entity.hasCompositePrimaryKey() )
|
||||
@IdClass(${jpaEntityIdClass}.class)
|
||||
#end
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@lombok.EqualsAndHashCode
|
||||
public class ${entity.name} implements Serializable {
|
||||
|
||||
|
||||
@@ -48,6 +48,11 @@
|
||||
<version>3.28.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-mongodb-panache</artifactId>
|
||||
<version>3.28.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.18.32</version>
|
||||
|
||||
@@ -50,6 +50,7 @@ public class ${entity.name}Processor implements CommandGet${entity.name}Processo
|
||||
${entity.name} entity = request.get${entity.name}();
|
||||
entity.setId(null);
|
||||
em.persist(entity);
|
||||
em.refresh(entity);
|
||||
return new CommandCreate${entity.name}Response(entity);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
## --------------------------------------------------
|
||||
#if ( !($entity.hasTag("Statistics")) )
|
||||
#cancel("Not a Statistics Model")
|
||||
#end
|
||||
##
|
||||
/*
|
||||
* Created on $now.date ( $now.time )
|
||||
* Generated by Telosys ( http://www.telosys.org/ ) version $generator.version
|
||||
*/
|
||||
package ${target.javaPackageFromFolder("persistence/${SRC}")};
|
||||
|
||||
import java.util.List;
|
||||
import io.quarkus.mongodb.panache.PanacheMongoEntity;
|
||||
|
||||
/**
|
||||
* Statistics entity class for "${entity.name}"
|
||||
*
|
||||
* @author Telosys
|
||||
*
|
||||
*/
|
||||
@lombok.EqualsAndHashCode
|
||||
public class ${entity.name} extends PanacheMongoEntity {
|
||||
|
||||
#foreach( $attribute in $entity.attributes )
|
||||
private $attribute.formattedType(10) $attribute.name #if($attribute.hasInitialValue())= ${attribute.ini} #end;
|
||||
|
||||
#end
|
||||
|
||||
#foreach( $link in $entity.links )
|
||||
private ${link.formattedFieldType(10)} $link.fieldName ;
|
||||
#end
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public ${entity.name}() {
|
||||
super();
|
||||
}
|
||||
|
||||
#foreach( $attribute in $entity.attributes )
|
||||
public void ${attribute.setter}( $attribute.type $attribute.name ) {
|
||||
this.$attribute.name = $attribute.name ;
|
||||
}
|
||||
public $attribute.type ${attribute.getter}() {
|
||||
return this.$attribute.name;
|
||||
}
|
||||
#end
|
||||
|
||||
#foreach( $link in $entity.links )
|
||||
public ${link.formattedFieldType(0)} ${link.getter}() {
|
||||
return this.${link.formattedFieldName(0)};
|
||||
}
|
||||
public void ${link.setter}( ${link.formattedFieldType(0)} $link.fieldName ) {
|
||||
this.$link.fieldName = $link.fieldName ;
|
||||
}
|
||||
#end
|
||||
|
||||
//--- toString specific method
|
||||
@Override
|
||||
$java.toStringMethod($entity, 1)
|
||||
}
|
||||
@@ -54,6 +54,7 @@ Java Command Models (P) ; ${BEANNAME}.java ; persis
|
||||
Java Command Processors (P) ; ${BEANNAME}Processor.java ; persistence/${SRC}/${ROOT_PKG}/persistence ; persistence/command_processor_java.vm
|
||||
Java Model Processors ; ${BEANNAME}Processor.java ; persistence/${SRC}/${ROOT_PKG}/persistence ; persistence/processor_entity_java.vm
|
||||
Java Filter Query Interface ; GenericFilterQuery.java ; persistence/${SRC}/${ROOT_PKG}/persistence ; persistence/generic_filter_query_java.vm ; 1
|
||||
Java Statistics Models ; ${BEANNAME}.java ; persistence/${SRC}/${ROOT_PKG}/persistence ; persistence/statistics_entity_java.vm
|
||||
|
||||
Java Command GetModels (P) ; CommandGet${BEANNAME}.java ; persistence/${SRC}/${ROOT_PKG}/persistence ; persistence/command/get_java.vm
|
||||
Java Command ListModels (P) ; CommandList${BEANNAME}.java ; persistence/${SRC}/${ROOT_PKG}/persistence ; persistence/command/list_java.vm
|
||||
|
||||
Reference in New Issue
Block a user