I use Hibernate in J2ee, when the datebase has't table the framework can create table and when fields changed it can update datebase, Can orm2 be done?
As this wiki pages explains, orm2 can create the database tables if they do not exist. Update of an database table is possible by another library, however i haven't tried this: https://github.com/dresende/node-orm2/issues/103
Related
I have got a web service which is looking for the last create table
[name_YYYYMMddHHmmss]
I have a persister job that creates and loads a table (insert or bulk)
Is there something that hides a table until it is fully loaded ?
First, I have created a technical table, it works but I will need one by keyspace (using cassandraAuth). I don’t like this.
I was thinking about tags, but it doesn’t seem to exist.
- create a table with tag and modify or remove it when the table is loaded.
There is also the table comment option.
Any ideas?
Table comment is a good option. We use it for some service information about the table, e.g. table versions tracking.
I'm using "sequelize" and "sqlite3"
But I don't know how to do even if the table s already exist in database.
i have seen the document , but it seems that must define the schema everytime even if the table already exist ?
If the table already in database , how can I use it without define schema again?
You can use sequelize-auto npm module for the same.
https://github.com/sequelize/sequelize-auto
I had the same situation before and used this npm module to generate the models, later can tweak or do some minor change if needed.
Schema (model) definition only represents table in database and does not create table itself.
If table already exist you need to define schema for this table only when app starts.
FWIW, if the table already exists, you need not use sync(); you can begin with User.create().
My question is pretty simple. I am working on Kentico 9 with its SQL Server database which contains several tables which had been added directly from the SQL Management Studio by an external contractor. The fact is that those tables are being used to store custom content which will be displayed for a site, but, in the code they don't have the code for making queries. I mean, they don't have Info and Provider classes.
https://docs.kentico.com/display/K82/Retrieving+database+data+using+ObjectQuery+API
According with this, all tables into the Kentico database can be accessed by invoking methods on these classes, but I don't have it this time.
Something like this, it will not work if I use my table name:
var user = UserInfoProvider.GetUserInfo("administrator");
var items = CustomTableItemProvider.GetItems("MyTable")
.TopN(10)
.WhereEquals("ItemCreatedBy", user.UserID)
.OrderBy("ItemCreatedWhen");
My question is:
can I query any table by its name?
One last thing:
I cannot declared those table as "custom table" because it seems to be a bug in the CMS.
Or you can pull data using your own SQL query:
var ds = ConnectionHelper.ExecuteQuery("select ....", null, QueryTypeEnum.SQLQuery);
Nevertheless I would recommend to create a custom class inside a custom module (much more robust than custom tables) instead and use the generated Info and InfoProvider classes to get and manipulate data.
I think an object has to be registered within the system (created through Kentico UI or API) in order to be pulled from DB with object query.
So I'd choose one of the following options:
Use Entity Framework or something similar to work with that data
Create appropriate custom tables or even custom module and push data there. Not sure why you can't create a custom table... What is an error you're getting?
If you need to present data on the UI only (without processing on the back end) - use just custom queries
Hope this helps.
If you are accessing in code then you could do it the good old fashioned way. If you want to pull data from the database to display on the website you could also do so by creating a custom query and using a transformation to display the fields, then use a repeater on the page to display the transformed data. Alternatively you can use a SQL datasource with a basic repeater, but you still have to create a transformation to display the data. Both methods allow you to access the data in the tables from within the CMS UI, no need to touch any code behind.
If your objective is to read data from these database tables to transform on webpage e.g. using CMS Repeater webpart, you can simply create custom query(s) in Kentico itself and load data using it. You can find the detail here on how to create custom custom queries and load data using it.
On the other hand you can also write your custom classes and define the custom methods where you can pull data using your own SQL query like this:
var ds = ConnectionHelper.ExecuteQuery("select ....", null, QueryTypeEnum.SQLQuery);
Lastly I don't think there should be any issue to create custom table instead of those direct DB tables, only thing we have to ensure code name of custom table should be unique means don't try to use exact same name because it'll cause exception due to same table name already exist in DB. You can please share exception you getting while creating custom table so that I can help you out further.
It is possible to specify or configure a custom datasource to load the select-options for a particular Data definition for Dynamic Data list?
The following image might clarify what I need to do:
Will it be possible that when the Dynamic Data form is shown to the User the values come from any of the liferay tables like User_, Group_ etc or from any custom plugin portlet's DB table etc.
Thanks
P.S.: Also posted on liferay forum: https://www.liferay.com/community/forums/-/message_boards/message/50483965
Can I prefix all the Liferay tables that it initially creates by doing some configuration changes.
I am new to Liferay and analyzing it for my use.
I gather that new tables being created are prefixed to avoid any conflicts but I have a situation where it suits me better if its other way round.
The answer is no for tables that Liferay creates on its first start. And as you have found yes for newly created tables using servicebuilder(uses the namespace tag)