Questions tagged [metamodel]

Metamodel is a collection of concepts (frames, rules, terms, constraints, models and theories) that are applicable and useful for modeling a predefined class of problems.

A model is an abstraction of phenomena in the real world; a metamodel is yet another abstraction, highlighting properties of the model itself. A model conforms to its metamodel in the way that a computer program conforms to the grammar of the programming language in which it is written.

Metamodeling, or meta-modeling in software engineering and systems engineering among other disciplines, is the analysis, construction and development of the frames, rules, constraints, models and theories applicable and useful for modeling a predefined class of problems.

Metamodeling is usually defines of a collection of concepts within a certain domain.

cf. wikipedia

225 questions
174
votes
12 answers

Get model's fields in Django

Given a Django model, I'm trying to list all of its fields. I've seen some examples of doing this using the _meta model attribute, but doesn't the underscore in front of meta indicate that the _meta attribute is a private attribute and shouldn't be…
Joe J
  • 9,985
  • 16
  • 68
  • 100
115
votes
9 answers

How to generate the JPA entity Metamodel?

In the spirit of type safety associated with the CriteriaQuery JPA 2.0 also has an API to support Metamodel representation of entities. Is anyone aware of a fully functional implementation of this API (to generate the Metamodel as opposed to…
Andrey
  • 8,882
  • 10
  • 58
  • 82
28
votes
2 answers

How to generate JPA Metamodel with Gradle 5.x

I am currently trying to upgrade from gradle 4.8.1 to 5.1.1 but fail with generating the hibernate metamodel for our code. The problem is that gradle 5 ignores the annotation processor passed with the compile classpath, but all plugins I found are…
FKorni
  • 405
  • 1
  • 5
  • 11
15
votes
2 answers

How to implement polymorphic JPA entities with generic relations

I'm trying to use JPA 2.0 to create polymorphic entities with generic relations. There should be two tables, an event table and a notification table. Inside those table are concrete entities that are related to one another, like so: Event …
logan
  • 3,416
  • 1
  • 33
  • 45
14
votes
1 answer

JPA/Metamodel: Strange (inconsistent ?) example in Sun Docs

In Sun Online resources, they provide son example about the usage of the Criteria/Metamodel API, but as far as I understand Java, it seems to be impossible to work: CriteriaQuery cq = cb.createQuery(Pet.class); Metamodel m =…
Kevin
  • 4,618
  • 3
  • 38
  • 61
14
votes
2 answers

JPA Criteria API: LEFT JOIN for optional relationships

I'm using the Criteria API basically the first time. It's about abstracting queries for a generic builder: public TypedQuery newQuery( Manager manager ) { CriteriaBuilder builder = this.entityManager.getCriteriaBuilder(); Class
Kawu
  • 13,647
  • 34
  • 123
  • 195
13
votes
5 answers

JPA Static Metamodel not recognized by IntelliJ

I generated the application with JHipster with Gradle as the build tool. When I created entity I added filtering support, which generated JPA static metamodel. But IntelliJ doesn't recognize the metamodels. I have enabled the annotation processor…
A0__oN
  • 8,740
  • 6
  • 40
  • 61
12
votes
4 answers

How can I discover all the roles a Perl 6 type does?

With .does I can check if a type has the role I already know. I'd like to get the list of roles. Inheritance has .^mro but I didn't see anything like that for roles in the meta model stuff. Along with that, given a "type", how can I tell if it was…
brian d foy
  • 129,424
  • 31
  • 207
  • 592
11
votes
2 answers

How to get SingularAttribute mapped value of a persistent object?

I have a persistent object (Action) and auto generated data model (Action_). By having an object of Action class and an instance of SingularAttribute, is it possible to get the field corresponding to the given SingularAttribute? I need a function…
Sadegh Ramezanpour
  • 193
  • 1
  • 1
  • 7
11
votes
3 answers

Koitlin support for JPA static metamodel

When I create an Entity class using Java JPA static meta models are generated. If I convert my Entities to Kotlin JPA static metamodels are not generated. How to solve this problem? EDIT I am using Gradle as build tool.
A0__oN
  • 8,740
  • 6
  • 40
  • 61
10
votes
1 answer

Load EMF Model instance in XTend

I am building a code generator in XTend where I already have an input model and meta model. That is, I use ATL to generate the input model for my XTend code generator (as part of a transformation sequence to gradually lower the abstraction level,…
Marten Sytema
  • 1,906
  • 3
  • 21
  • 29
9
votes
2 answers

Why do the JPA2 MetaModel get generated with volatile members?

I have just used org.apache.openjpa.persistence.meta.AnnotationProcessor6 to generate the MetaModel for my JPA2 entities. @javax.annotation.Generated (value="org.apache.openjpa.persistence.meta.AnnotationProcessor6", date="Tue Nov 22 09:49:03…
planetjones
  • 12,469
  • 5
  • 50
  • 51
9
votes
1 answer

Hibernate/JPA - NullPointerException when accessing SingularAttribute parameter

I'm trying to use JPA2 type-safe criteria queries with Hibernate 5.0.7.Final. ... criteria.where( builder.equal( root.get(SingularAttribute.attr), value )); //where parameters are //criteria.where( builder.equal( root.get(Person_.name), "Can"…
Can UNSAL
  • 91
  • 1
  • 7
9
votes
3 answers

Creating queries using Criteria API (JPA 2.0)

I'm trying to create a query with the Criteria API from JPA 2.0, but I can't make it work. The problem is with the "between" conditional method. I read some documentation to know how I have to do it, but since I'm discovering JPA, I don't understand…
Pym
  • 1,018
  • 3
  • 13
  • 17
8
votes
1 answer

What is the "semantic model" introduced in Apocalypse #1?

In Apocalypse #1 Larry wrote, with my added emphasis: Raku will support multiple syntaxes that map onto a single semantic model. Second, that single semantic model will in turn map to multiple platforms. Some vague notions I have of what Larry…
raiph
  • 31,607
  • 3
  • 62
  • 111
1
2 3
14 15