while understanding CDS views,I've come across something like 'meta-model' could anyone please explain me what does it mean?
Thanks in advance.
Not an official term.
Guess you're refering to its usage in the article ABAP Core Data Services – Introduction (ABAP CDS view)?
The article uses the term "meta model" to refer to annotations in CDS views. Annotations describe the meaning, application, and properties of entities, fields, and associations in CDS views.
For example, an annotation might say that an association joins a text for a code field or that a field should be used for fuzzy search.
While the select and calculations in the CDS view tell you how to produce the actual data (= the model), the annotations tell you how to interpret that data (= the meta model).
Related
To set the preface: I am a programmer with very limited experience in programming other than COBOL like languages which means I am very new to JVM based programming languages. But I been using python for personal use and am not completely new to modern age programming concepts. Benefit of new bee is expected and please don't shoot down the post.
I am looking to write a query tool. When a query is executed, the data is presented to the user in a table view. So as you can imagine the columns list going to be as dynamic as it can get. Closest I found about dynamic table view creation is here
Dynamic table columns
To write an MVC based query tool, how should the model be created? So that when the data in the table view is updated, it can be updated back to the database and vice versa.
I will assume that when you say 'dynamic table columns' you just mean table columns in which you edit data in the columns and it gets relayed back to the View Model. If you look at the guide in this page and go to the section Using "Property" properties. It talks about how you can make columns editable. In terms of handling data, this section talks all about the basic structure of MVVM. In your case, your database data would be represented by a class representation that writes and reads based into class members. That implementation is up to you however.
Anyone know if a ABAP CDS View on a S4/Hana System run at the same engine of a Calculation View of HANA?
In other words ABAP CDS View (on S4/HANA) is equal to Calculation View in Hana?
Thank you.
They are separate things. You need some modifications to convert them to each other. Find a good blog post about the concepts here.
The Sparx Enterprise Architect Searches are great, however I would like to search for all requirements linked to a specific object (Activity) which I have included on a specific diagram. On that Diagram, I have added a model view (which can display a SQL query result)
My question is - Is there any way to obtain some sort of contextual perspective to use in the query? - essentially, I would like to know the diagram guid which the ModelView is being run by.
Personally I don't use Model Views, but AFAIK there's nothing extending SQL in that direction. You might want to send a feature request. But don't hold your breath.
On the other hand, if you hard code the GUID of a query, it will work for individual diagrams only. That calls for maintenance issues. Rather, you could stereotype diagrams and use that information in your query.
For a Client of mine I'm documenting an existing database with a few tables and some queries.
For tables I'm using E-R Diagram to show tables and relationships. I'm doing that with DIA Diagram Editor.
How do I describe and visualize queries? There exist some sort of UML Object to do that?
So far, I've created a table with query name and a description of what it does and an example screenshot of data retrieved by the query itself. I'm doing that in Word.
I don't like the result of this work, there exist something more professional to do that?
I wouldn't install new software just know how database designers have to accomplish that task.
EDIT 1
As #Serg suggested I may use view and diagramm the view as an entity.
If I've understood something like:
What the client needs is to understand for each query where data come from.
EDIT 2
I'm doing something like the following:
Where
driver_tabella_utenti is a TABLE
driver_imp_causali_preparazione is a QUERY
driver_query_riepilogo_prsp is a QUERY
I think that isn't bast practice! How can I visual design sql queries as I do with entities and relationships?
Short summary
I see 2 options based on specification. This is only based on specification taken literally, not any additional research on the web.
Model class providing an operation representing what the SQL query does. Present a behavior describing this operation as a class stereotyped with <> and with linked object of a type OpaqueBehavior with provided values for attributes body (an SQL query) and language ('SQL').
Model class providing an operation representing what the SQL query does. Provide a note linked to the class containing description of respective OpaqueBehavior (body and language)
I've found another solution in the Specification
Model SQL query as action. The action can be depicted as usually in activity diagram (rectangle with rounded corners) and put SQL directly inside of the rectangle. The action needs to be a part of activity diagram (that is a description of a behaviour that utilizes this SQL).
Explanation
You can use a BehavioralFeature (e.g. Operation) to define that there is some SQL available (it sould be some class that exposes this operation) and then you can define a method with describing OpaqueBehavior (method) that contains body (SQL statement) and language ('SQL').
As specification does not provide any information about notation you can specify it either representing a method as an object (this is a specific instance of OpaqueBehavior) or using a note. In both cases it should be linked to a respective object describing the Behavior provided by the SQL statement as such (e.g. activity).
See 13.2.3.3 of UML Sepcification. Below is just the diagram describing this area.
Edit as a result of further research:
UML Specification describes literally your case in section 16.2 (as OpaqueAction). An example figure 16.8 in section 16.2.5.1 is exactly the case I've described as a 3rd possible answer.
Note however (as already mentioned in comments) that UML is not always the best suitable solution. While I strongly recommend modelling the system using UML, the SQL code itself should be a part of textual documentation that should be created together with the UML diagrams. It will benefit from more clarity, possibility to search, possibility to copy-paste the code etc. Also if your query is more than 2-3 short lines it might even hard to notice that it is still a part of an UML diagram.
My team is writing a large scale business website in ASP.NET MVC 4 using the database-first approach. Does anyone know if it's possible to have data annotations automatically generated based on the database schema? It seems redundant to have to manually write the "buddy" metadata classes containing the data annotations when the framework should be aware of a database column's properties and make these part of the POCO classes it generates. Any suggestions would be greatly appreciated!
Take a look at LINQ to SQL.
You can use it to create a .dbml file in a graphical editor by dragging the tables from the server explorer.
Here's the MSDN How to: Create LINQ to SQL Classes in a Web Project
1) The framework does a good job of extrapolating data annotation based on table structure, but they won't be perfect.
2) Sadly, when you reach a point when you want to customize more than the framework, you are stuck with Buddy classes. They're a bit tedious but so far the best method I've found for customizing data annotation.
3) All too often, I find myself gravitating toward custom classes and away from generated POCO's. The reason is usually the differences between storing and displaying. In entry screens
I will often break up phone #'s into 3 textboxes.
Lookups for foreign keys require select lists (often added to model).
Often I'll pass other values that may be relevant to my View functionality but not specific to the storage table (display fields, navigation / bread crumbs)
Use the Database First approach with the Entity Framework.
You can generate the entity model from an existing database using the entity data model wizard.
See http://msdn.microsoft.com/en-us/data/jj206878
#Kerezo covers pretty much exactly what you want to do here: Add Data Annotation To Entity Framework(Or Linq to SQL) generated class
It is not possible to auto generate the data annotations automatically.