Class: RepositoryGenerator
- Inherits:
-
BaseScaffold
show all
- Defined in:
- lib/vraptor-scaffold/generators/scaffold/repository_generator/repository_generator.rb
Instance Method Summary
collapse
#base_path, #class_name, #controller_class_name, #controller_test_class_name, #initialize, #model_list_name, #model_parameter_name, #repository_impl_name, #repository_interface_name, #repository_test_class_name, #test_class_name
Constructor Details
This class inherits a constructor from BaseScaffold
Instance Method Details
#orm_class ⇒ Object
20
21
22
|
# File 'lib/vraptor-scaffold/generators/scaffold/repository_generator/repository_generator.rb', line 20
def orm_class
orm_parameter_name.camelize
end
|
#orm_import ⇒ Object
10
11
12
13
|
# File 'lib/vraptor-scaffold/generators/scaffold/repository_generator/repository_generator.rb', line 10
def orm_import
return "org.hibernate.Session" if Configuration.hibernate?
"javax.persistence.EntityManager"
end
|
#orm_parameter_name ⇒ Object
15
16
17
18
|
# File 'lib/vraptor-scaffold/generators/scaffold/repository_generator/repository_generator.rb', line 15
def orm_parameter_name
return "session" if Configuration.hibernate?
"entityManager"
end
|
#source_root ⇒ Object
28
29
30
|
# File 'lib/vraptor-scaffold/generators/scaffold/repository_generator/repository_generator.rb', line 28
def source_root
File.join File.dirname(__FILE__), "templates"
end
|
#template_path ⇒ Object
24
25
26
|
# File 'lib/vraptor-scaffold/generators/scaffold/repository_generator/repository_generator.rb', line 24
def template_path
"src/templates/repositories"
end
|