deals with issues related to the definitions of domain model
Questions tagged [grails-domain-class]
689 questions
0
votes
1 answer
Setting nullable from the static mapping block
I have a situation where I'd rather not use the built-in constraints.
We do use the constraints (currently) to drive database schema creation. It seems (from what I've checked thus far) that all the bases are covered if we stop using built-in…

user1373467
- 315
- 3
- 12
0
votes
1 answer
using grails
I have general question regarding using remoteFunction. I am using the like
i am making call to controller. I want to update a textbox based on the object from controller.

Suryateja Kosaraju
- 493
- 1
- 7
- 14
0
votes
1 answer
Is this a safe way to access Grails Configuration in static mapping block?
I am using the ApplicationContext passed in by Grails to the mapping closure in domain objects to get to the configuration information, like so
static mapping = { applicationContext ->
…

user1373467
- 315
- 3
- 12
0
votes
3 answers
Grails, change domain class property from gsp
what's the method used to change a domain classes property within the gsp?
Ex:
a domain class project has a dueDate which is of type date.
I want to within the gsp, set its date without using the tag
The reason is, I'm using jquery's datepicker…

Riveascore
- 1,724
- 4
- 26
- 46
0
votes
1 answer
Extending domain classes results in strange table layout and non-accessible fields
I have a domain class User defined as
class User extends SecUser{
String fullName
String address
String city
String country
String role
String email
String schoolName
String gradeLevel
static constraints = {
…

Jason
- 11,263
- 21
- 87
- 181
-1
votes
1 answer
Defining a Grails 3.0 plugin domain class to be extendable
When developing a Grails 3.0 plugin:
How should a domain be defined so that it can be extended by the application using the plugin?
How does the plugin reference instances of the extended class?
As an example, a security plugin could have classes…

Dem Pilafian
- 5,625
- 6
- 39
- 67
-1
votes
1 answer
How to define a random Id to database table id in mongoDb database using grails 2.2.2?
I am using MongoDb database and grails 2.2.2
in this i want to assign a random Id rather than by default incremental Id generating by Db.
for e.g : abcd.com/demo/view/14524 rather than
abcd.com/demo/view/5
my domain code:
student.groovy
class…

SAGAR MANE
- 685
- 2
- 8
- 23
-1
votes
2 answers
get values of variable defined on controller without writting query in action
I have the following code in my Controller.
class WorkStationAssetController {
def requestList = Request.list()
def list = {
[requestList :requestList]
}
def save = {
def requestInstance = new…

Hardik Patel
- 937
- 3
- 14
- 39
-2
votes
1 answer
GORM Simple Query but VERY slow
I am using grails 2.3.8 with mysql database. I have this domain class with 200,000 records. It takes 18 seconds to retrieve.
class Alert {
Long id
int recorded_at
int responded_at
String source_name
String source_type
String…

user903772
- 1,554
- 5
- 32
- 55
-2
votes
1 answer
Grails Domain class JSON
I have this controller:
respond :Alert.list()
It gives:
[{id: ..}, {id: ..}]
What I want:
{"alerts":[{"id":...}. {id:..}]}
How do I let the respond make into the format I want? I don't want to have a custom JSON marshaller as my dataset is…

user903772
- 1,554
- 5
- 32
- 55
-2
votes
1 answer
save a same value using unique constraint with different foreign key id in grails
I have a domaing named Thana where I save thanaName with the parent id of district. I have used unique constraint for thanaName. When I save thana with a name suppose 'Thana A' with the district foreign key value 1 it's saved. When I want to save…

Sumon Bappi
- 1,937
- 8
- 38
- 82
-3
votes
2 answers
Grails Relation m:n:n
We work with an existing mysql database under grails which contains a m:n relation. No problem here. But now we are in the situation that i have to add a second n relation entry, which links to the same table and has to be associated to the first n…

syck
- 2,984
- 1
- 13
- 23
-3
votes
1 answer
How do I implement a LinkedList with Grails GORM Domain Classes?
I want to implement a linkedList with Grails domain classes. The base class is the following:
class Node {
String text
Node predecessor
Node successor
public static remove(Node n) {
def node = Node.get(n)
…

Michael
- 32,527
- 49
- 210
- 370
-6
votes
3 answers
Modelling a complex domain model with grails
I am building a web application with Grails and need to model a complex organisational structure. i.e.
Organisation
Department
Office
People
And retrieve a list of people at each level of the heirarchy. The problem is that Grails does not seem to…

eaglestorm
- 1,192
- 1
- 13
- 32