Top 100+ Groovy On Grails Interview Questions And Answers
Question 1. What's Is Groovy?
Answer :
is an dynamic, object orientated, scripting language that it is compiled in byte code and runs over the JVM. This language include a few functions like metha programing, closures, and many others.
Question 2. What Is Grails?
Answer :
Grails is an open supply internet utility framework that uses the Groovy and Java as programming language, this framework use every other frameworks like Spring, Hibernate, SiteMesh and feature an embedded H2 database, Tomcat server and ORM(GORM). This framework follow a few design patterns as Model View Controller(MVC), Convention Over Configuration(CoC), Don't repeat yourself(DRY) and runs over the Java Virtual Machine(JVM).
Web Services Interview Questions
Question 3. What Is Orm?
Answer :
means item relational mapping, A simple solution is which you wrap your tables or saved strategies in training on your programming language, so that instead of writing SQL statements to interact together with your database, you operate techniques and residences of objects.
It's a library or framework that assist you to map/convert your fashions in to tables for your database, It's like a mediator or an intermediate that avoid that you need to write SQL code and lets in you to interact with the DB using a programming language like groovy without should fear about write SQL code or what kind of database are you the use of, you can switch from mySql to Oracle DB enhancing only 4 strains of code, an instance of what's an ORM It's the Hibernate Framework.
Question 4. What Is Gorm?
Answer :
GORM is Grails' object relational mapping (ORM) implementation. Under the hood it makes use of Hibernate (a totally famous and bendy open source ORM solution) and thanks to the dynamic nature of Groovy with its static and dynamic typing, together with the conference of Grails, there may be far much less configuration worried in creating Grails area training.
Web Services Tutorial
Question five. What Is The Command To Create A New Application In Grails?
Answer :
grails create-app "the call of your app"
HTML 5 Interview Questions
Question 6. What Is The Command To Run A Grails Application?
Answer :
grails run-app
Question 7. What Is The Command To Create A Domain Class?
Answer :
Grails create-domain-elegance "package deal" +"call of your area elegance".
HTML 5 Tutorial J2EE Interview Questions
Question 8. What Is The Command To Create A Controller?
Answer :
grails create-controller "package" +"call of your area elegance"
Question 9. What Are The Default Environments In Grails?
Answer :
Development, Test And Production
Angular JS Interview Questions
Question 10. What Is The Command To Generate A War File?
Answer :
grails warfare
J2EE Tutorial
Question 11. What Is The Command To Run Your Application In A Different Environment That Development?
Answer :
grails -Dgrails.Env=take a look at run-app
CSS Advanced Interview Questions
Question 12. What Is The Command To Run You Application In A Different Port Than 8080?
Answer :
grails -Dserver.Port=9090 run-app
Web Services Interview Questions
Question 13. What Is The Command To Do Static Scaffolding Of A Controller?
Answer :
grails generate-controller "packpage"+"domain magnificence"
CSS Advanced Tutorial
Question 14. What Is The Command To Do Static Scaffolding Of The View Of A Domain?
Answer :
grails generate-views "packpage"+"domain class"
Question 15. What Is The Command To Generate The Static Scaffolding Of The Controllers And Views Of A Domain Class?
Answer :
rails generate-all "packpage"+"domain magnificence"
Javascript Advanced Interview Questions
Question sixteen. What Is The Command To Generate The Static Scaffolding Of The Controllers And Views Of All Your Domain Classes?
Answer :
grails generate-all "*"
Javascript Advanced Tutorial
Question 17. What Is The Command To Stop Your Application?
Answer :
grails stop-app
Restful net provider Interview Questions
Question 18. What Is The Command To Test Your Application For Unit Test Only?
Answer :
grails check-app --unit
HTML 5 Interview Questions
Question 19. What Is The Command To Test Your Application For Integration Test Only?
Answer :
grails test-app --integration
Restful net service Tutorial
Question 20. What Is The Command To Rerun Test In Your Application?
Answer :
grails test-app --rerun
Groovy (programming language) Interview Questions
Question 21. What Is The Command To See Your Grails Version?
Answer :
grails -model
Question 22. What Is The Command To Create The Unit Test Of A Domain Class?
Answer :
grails create-unit-test "packpage"+"area magnificence"
Question 23. What Is The Command To Create The Integration Test Of A Domain Class?
Answer :
grails create-integration-test "packpage"+"domain class"
Advanced jQuery Interview Questions
Question 24. What Is Data Binding?
Answer :
It's the act of binding incoming request parameters on to the properties of an object.
J2EE Interview Questions
Question 25. Where Do You Setup Your Db , Hibernate Version And Environments?
Answer :
DataSource.Groovy
Question 26. Where Do You Setup Your Dependency Manager, Your Repositories, Dependencies And Plugins?
Answer :
BuildConfig.Groovy
Restaurant Manager Interview Questions
Question 27. What Is The Difference Between Buildconfig.Groovy And Config.Groovy?
Answer :
that Config include configuration needed to run your application and BuildConfig consist of configuration to construct and deploy your application.
Angular JS Interview Questions
Question 28. What Do You Have To Do If You Don't Want That A Property Of Your Domain Be Mapped To The Db?
Answer :
for your area class:
static brief['can't save this']
Question 29. What Is Metaprogramming?
Answer :
It's the groovy capability to add new methods or variables to classes dynamically at run time, and without touching the code.
Soap Web Services Interview Questions
Question 30. Could You Give Me An Example Of Meta Programming In Grails?
Answer :
The dynamic finders inside the domain names class.
Question 31. What Is Pessimistic Locking?
Answer :
Locking a row till the present day transaction is finished. This has the implication that other read operations could be blocking until the lock is launched.
Question 32. How Do You Configuring Eager Fetching In A Domain Class?
Answer :
lazy: false
or
fetch: 'be part of'
Example:
elegance Airport
String call
static hasMany = [flights: Flight]
static mapping =
flights lazy: false //here you configure keen fetching
elegance Person
String firstName
Pet pet
static hasMany = [addresses: Address]
static mapping =
addresses lazy: false
puppy fetch: 'be a part of' //that is some other way to configure keen fetching
Java nine Interview Questions
Question 33. What Is The Configuration File To Define Url Pattern And Its Controller And Action Name?
Answer :
grails-app/conf/UrlMappings.Groovy.
CSS Advanced Interview Questions
Question 34. What Is Another Way To Make A Transaction Method That Not Use The Transactional Annotation In Grails?
Answer :
Using the ".WithTransaction" technique
Example:
Account.With Transaction status ->
def source = Account.Get(params.From)
def dest = Account.Get(params.To)
int quantity = params.Quantity.To Integer()
if (supply.Active)
source.Balance -= amount
if (dest.Active)
dest.Quantity += amount
else
reputation.SetRollbackOnly()
Question 35. How You Can Make A Method Not Transactional If The Whole Class Was Marked As Transactional?
Answer :
the use of the annotation @NotTransactional above the technique's call inside the carrier
Example:
import grails.Transaction.Transactional
@Transactional
elegance BookService
@NotTransactional
def listBooks()
Book.Listing()
Question 36. How You Can Made A Method Of A Service Be Transactional?
Answer :
With the annotation @Transactional above the technique's name of the carrier
Example:
import grails.Transaction.Transactional
magnificence BookService
@Transactional
def updateBook()
// …
Javascript Advanced Interview Questions
Question 37. How Can You Made A All The Method Of A Service In Grails Be Transactional?
Answer :
With the annotation @Transactional above the magnificence's call
Example:
import grails.Transaction.*
@Transactional
elegance Country Service
Question 38. What Is The Use Of Flush Option In Save Operation Of A Domain?
Answer :
Saves the row straight away without any delay.
Example
def e-book = new Book(name:"New Grails Book")
ebook.Save(flush:actual)
Question 39. How You Can Create Many-to-many Relationship In Gorm?
Answer :
Many-to-many relationships in Grails can be designated via defining a has Many assets on each aspects and having a belongs To at the owned facet:
class Tag
static belongsTo = Post
static hasMany = [posts: Post]
class Post
static hasMany = [tags: Tag]
Question forty. What Is A Grails Plugin?
Answer :
It's a bundle/set of capability to a desired suggest that may be hooked up on your grails software.
Restful net service Interview Questions
Question 41. How Use Dynamic Scaffolding In Your App?
Answer :
on your controller:
def scaffold=genuine or def scaffold="the name of your area class"
Question 42. How Render A Template In A View In Grails?
Answer :
use the tag:
<g:render template="form"/>
Groovy (programming language) Interview Questions
Question forty three. How Do You Inject A Service In Your Controller?
Answer :
def taskService
Question forty four. What Option Do You Use To Create War File For Specific Environment?
Answer :
Dgrails.Env
Example : grails -Dgrails.Env=dev struggle