简体   繁体   English

如何在Tapestry5应用程序中实现类似django的管理命令?

[英]How to implement django-like management commands in Tapestry5 app?

I want to executie custom (groovy/clojure/java/whatever) "scripts" as command line commands to do some tasks with Tapestry5 app (it's hibernate part, really). 我想执行自定义(groovy / clojure / java / whatever)“脚本”作为命令行命令,以通过Tapestry5应用程序执行某些任务(实际上是休眠部分)。 To perform a migration from previous database to the new one, for example. 例如,要执行从以前的数据库到新数据库的迁移。 I wonder if there is a way to use "tapestrified" entities? 我想知道是否有一种使用“混杂的”实体的方法?

I've tried to implement this using gradle tasks, separate clojure scripts (with maven plugin inside main pom file), but it seems that they do not have access to hibernate session, so i can't really do something with database. 我试图使用gradle任务,单独的clojure脚本(在主pom文件中带有maven插件)来实现此目的,但是似乎它们没有访问休眠会话的权限,因此我无法真正对数据库执行任何操作。

I'm very new to java world (i have some expirience with clojure and a very little expirience with scala), so maybe i'm missing something about "enterprise" tools. 我是Java世界的新手(我对clojure有一些经验,而对scala有一点经验),所以也许我缺少有关“企业”工具的知识。

The question is: is there an "official" way to accomplish such tasks? 问题是:是否存在“官方”方式完成此类任务?

Do you mean database changelogs? 您是指数据库变更日志吗? If so then you do not need to use tapestry or hibernate. 如果是这样,则无需使用挂毯或休眠方式。 You can look at http://www.liquibase.org/ or google something similar. 您可以查看http://www.liquibase.org/或Google类似的网站。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM