telosys-tools-bricks / telosys-cli Goto Github PK
View Code? Open in Web Editor NEWTelosys CLI - Command Line Interface
Home Page: https://www.telosys.org/
License: GNU Lesser General Public License v3.0
Telosys CLI - Command Line Interface
Home Page: https://www.telosys.org/
License: GNU Lesser General Public License v3.0
Keep the current model and the current bundle in a properties files
Hello, here is a MySQL script below. Can Telesys-cli create classes with Hibernate annotations based on this script? How to launch it during the build of the Java Maven project?
CREATE TABLE IF NOT EXISTS orders (
order_id INT PRIMARY KEY,
order_number VARCHAR(128),
order_data VARCHAR(4096),
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
)ENGINE=INNODB;
CREATE TABLE IF NOT EXISTS invoices (
invoice_id INT PRIMARY KEY,
order_id INT UNIQUE,
INDEX ord_id (order_id),
FOREIGN KEY (order_id)
REFERENCES orders(order_id)
ON DELETE CASCADE,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
)ENGINE=INNODB;
is not possible to do some like this.
for example:
tt -h "C:\x\y"
tt -ndmb
tt -b "somebundle"
tt -gen * *
so this way it would be automatic process without user interaction.
Hi @l-gu ,
I'm the sysadmin @ OW2 and I'm trying to reach you through the email we have at our end without any success, this is why I'm using an issue. Could you get in touch with our Management Office so we can review everything about the project.
Regards,
For commands "lb", "lgh", "lm", etc
Keep the last list in memory
Allow to use the id for "ib", "b", "m", "dm", "db"
Examples :
lgh
1 - xxxx
2 - xxxx
ib 1 ( install bundle 1 )
lb
1 - xxx
2 - xx
db 2
Trying to build project with Maven, got the following error:
[ERROR] Failed to execute goal on project telosys-cli: Could not resolve dependencies for project org.telosys:telosys-cli:jar:3.1.0-001: Could not find artifact org.telosys:telosys-tools-all:jar:3.1.0 in central (https://repo.maven.apache.org/maven2) -> [Help 1]
@l-gu How can I build the code?
Thanks.
I have one template.cfg file and multiple models, currently in templates.cfg file, I have one line of code:
dao; ${BEANNAME}DAO.cfc ; sql ; dao.vm ; *
This will generate multiple files and each file will base on the model name. But I would the file to be the database table name not the model name.
Database table is in model file:
@DbTable(resource_versions)
In this case, I would the file generated as reosurce_versionsDAO.cfc not resourceVersionsDAO.cfc.
Any solutions?
I asked the same question here https://stackoverflow.com/questions/78395741/telosys-custom-basename. Got an answer from Igu, I currently don't know how to apply the answer.
Hi, and thanks for this product.
I'm looking into trying out Telosys and the first thing I checked was whether a primary key can be binary. And Telosys doesn't allow that 😔
If you're fine with adding this feature, I could send a pr if you can direct me more or less where to look in the sources?
[ERROR] Terminal initialization failed; falling back to unsupported
java.lang.NoClassDefFoundError: Could not initialize class org.fusesource.jansi.internal.Kernel32
at org.fusesource.jansi.internal.WindowsSupport.getConsoleMode(WindowsSupport.java:50)
at jline.WindowsTerminal.getConsoleMode(WindowsTerminal.java:204)
at jline.WindowsTerminal.init(WindowsTerminal.java:82)
at jline.TerminalFactory.create(TerminalFactory.java:101)
at jline.TerminalFactory.get(TerminalFactory.java:158)
at jline.console.ConsoleReader.<init>(ConsoleReader.java:229)
at jline.console.ConsoleReader.<init>(ConsoleReader.java:221)
at jline.console.ConsoleReader.<init>(ConsoleReader.java:209)
at org.telosys.tools.cli.TelosysCLI.<init>(TelosysCLI.java:46)
at org.telosys.tools.cli.TelosysMain.main(TelosysMain.java:35)
←[36;1m
______ __
/_ __/__ / /___ _______ _______
/ / / _ \/ / __ \/ ___/ / / / ___/
/ / / __/ / /_/ (__ ) /_/ (__ )
/_/ \___/_/\____/____/\__, /____/
/____/ 3.0.0 CLI-012←[0m
Enter ? for help
←[32mtelosys>←[0mERROR : Unexpected exception null
[WARN] Task failed
java.lang.NoClassDefFoundError: Could not initialize class org.fusesource.jansi.internal.Kernel32
at org.fusesource.jansi.internal.WindowsSupport.setConsoleMode(WindowsSupport.java:60)
at jline.WindowsTerminal.setConsoleMode(WindowsTerminal.java:208)
at jline.WindowsTerminal.restore(WindowsTerminal.java:95)
at jline.TerminalSupport$1.run(TerminalSupport.java:52)
at jline.internal.ShutdownHooks.runTasks(ShutdownHooks.java:66)
at jline.internal.ShutdownHooks.access$000(ShutdownHooks.java:22)
at jline.internal.ShutdownHooks$1.run(ShutdownHooks.java:47)
i have already installed visual c++ 2008 sp1. it's impossibile to made any operation, like update model or entity generation. only unprompted command like home definition
Hi
Im trying to understand what a bundle
is, and how to move past the Bundle-name must be set before using this command!
step.
I've tried the following:
telosys#(Person.model)>b
Undefined (no current bundle)
telosys#(Person.model)>nb test
Invalid command 'nb'
telosys#(Person.model)>lb
1 bundle(s) :
. java7-web-rest-jaxrs1-T300
telosys#(Person.model)>ib java7-web-rest-jaxrs1-T300
Installing 1 bundle(s) from GitHub...
. 'java7-web-rest-jaxrs1-T300' : installed.
telosys#(Person.model)>gen
Bundle-name must be set before using this command!
telosys#(Person.model)>gen test
Bundle-name must be set before using this command!
telosys#(Person.model)>eb
Bundle-name must be set before using this command!
telosys#(Person.model)>eb
Bundle-name must be set before using this command!
telosys#(Person.model)>b
Undefined (no current bundle)
Hi,
I installed the telosys-cli following the wiki installation page.
I downloaded from website, unzip in C:\Program Files\telosys-cli, and added the path to this folder int PATH variable.
But when I try the tt command in cmd.exe, I got an error. This is the output of command-line :
Microsoft Windows [version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. Tous droits réservés.
C:\Users\trenaud>tt
Error: Unable to access jarfile C:\Program
C:\Users\trenaud>
What am I doing wrong ?
Tristan
after generating the source code, i am unable to find Record, JpaRecord and JpaMapping classes in the generated sources.
Having hopefully configured everything properly, it seems that ndbm cannot find any table in my DB.
telosys#>ndbm
WARNING :
You're about to create a new model from a database
This operation can take a lot of time (especially for Oracle databases)
The model file 'RCS Monitoring.dbrep' already exists.
The existing file will be overridden !
Do you really want to launch the model creation ? [y/n] ? y
Generating the new model...
[INFO] Creating new db-model from database 1
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
Getting database metadata
Getting tables metadata
0 table(s) found
End of metadata processing : 0 table(s) processed.
[INFO] Saving model in file C:\Users\mbresciani\Desktop\telosys-cli-3.1.0-002\TelosysTools\TestDB.dbrep
[INFO] Repository saved.
New model created.
The cdb command works properly.
telosys#>cdb
Checking database...
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
OK, connection test is successful.
Am I missing something in the configuration?
<db id = "1"
name = "TestDB"
driver = "com.mysql.jdbc.Driver"
url = "jdbc:mysql://localhost:3306/TestDB"
typeName = "MYSQL"
dialect = "org.hibernate.dialect.MySQLDialect"
isolationLevel = "TRANSACTION_REPEATABLE_READ"
poolSize = "3" >
<property name="user" value="root" />
<property name="password" value="password" />
<metadata catalog="" schema=""
table-name-pattern="%"
table-types="TABLE VIEW"
table-name-exclude=""
table-name-include="" />
</db>
Hello and thanks for this wonderful tool.
I looked around for a function that can convert a string_with_underscores
to a camelCase format stringWithUnderscores
, but I cannot seem to find such a function.
Is there such a function? How easy it would be to submit a pr to add it?
Why, you'd ask?
Because if field name have a prefix (personal_computer_model
, personal_computer_ram
, etc) matching the catalog name (personal_computer
), then when auto-generating an entity, there's no need to have the properties named:
personalComputerModel
personalComputerRam
but rather, just:
model
ram
and the class would be named: personalComputer
.
Makes sense? :)
Description:
I try to use custom function return arraylist and here is my function in java
private static Map<String, List<String>> map = Map.of(
"Long", Arrays.asList("null", "1", "2"),
"Boolean", Arrays.asList("null", "True", "False"),
"BigDecimal", Arrays.asList("null", "BigDecimal.ZERO", "BigDecimal.ONE"),
"LocalTime", Arrays.asList("null", "LocalTime.of(0, 0, 0)", "LocalTime.of(1, 1, 1)")
);
public static ArrayList<String> getValuesByFieldName(String filedName) {
return new ArrayList<>(map.get(filedName));
}
}
And there is my velocity.vm
#set($FieldUtil = $loader.loadClass("com.example.codegenerator.telosys.util.FieldUtil"))
#set($myJavaList = $FieldUtil.getValuesByFieldName('Long'))
$myJavaList.class.name
$myJavaList
### Will throw no attribute '['
$myJavaList[0]
#set( $mylist = [1, 2, 3, "A", true, 65.78] )
$mylist.class.name
$mylist
### It is okay here
$mylist[0]
I find that even though they have same type(java.util.ArrayList), the myJavaList not work
Version use: telosys-cli-4.1.1-001
Expected behaviour
I expect they can both use the same operator which I can access the element using bracket notation here. Hope I specify the problem clearly
Hi Lauren
You mentioned that you will add a feature to allow to use typed parameters for inhereted class like Event:
public class Event : FullAuditedAggregateRoot
or
public class Event : FullAuditedAggregateRoot
Here there are some inhereted properties and one of them is
Id which becomes Guid type as concrete type or int depending on how you pass concrete type parameter.
Please add it in version 4 as well as Guid type. It is ugly do use tags to skip Id field when looping over attributes since it is
implicitly defined.
https://stackoverflow.com/questions/70092361/generating-class-in-c-sharp-that-inherits-a-generic-class-which-uses-type-parame
Your comment:
Regarding the class, for the moment there are no annotations (or tags) at the entity level (it will happen soon).
We also don't have ability do desigate what base class we want to inherit.
In abp.io framework I have ability to do this:
public class Event : AggregateRoot
public class Event : Entity
I have to use some external .json file to provide extra metadata
Thanks
Rad
Short of doing a string replace inside the DBREP file is there a way to start using a more current Java date?
Also on a similar note is there a way to mark the concept of timestamp with timezone?
I configured the mysql database in databases. DBCFG but used the CDB command in cli to make an error:Exception class: TelosysToolsException
Exception Message:Cannot connect to the database(SQLException)
if u know why,please answer me ,thanks
Hi !
In first, I'd like to thank you for this project. I was looking for a simple code generation tool for my own python project, and this one works very nice. I don't like UML :)
I'm trying to create an entity with an attribute that refers to a collection, but it doesn't work at all.
I created 2 files (one named Folders.entity and the other one named File.entity). My goal is to create a class with an attribute that refers to a list of sub documents (NoSQL).
Folders {
id_: string ;
name : string ;
files: File [ ];
}
File {
name : string;
}
During the generation, this attribute (files) doesn't exist.
I put the following code in a .vm file :
#foreach( $attribute in $entity.attributes )
$attribute.name : $attribute.type
#end
And it only displays the id_, and name attribute). Do you know where the problem comes from ? I'm using telosys (3.1.0).
If an ENTITY doesn't have any @id add "(!) No ID" at the end of the line
Same thing in "cm" command
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.