Exporting MS Access Forms and Class / Modules Recursively to text files?

You can also try this code. It will preserve the items’ filetypes (.bas, .cls, .frm) Remember to refer to / Check the Microsoft Visual Basic For Applications Extensibility Library in VBE > Tools > References Public Sub ExportAllCode() Dim c As VBComponent Dim Sfx As String For Each c In Application.VBE.VBProjects(1).VBComponents Select Case c.Type Case … Read more

Get actual type of generic type argument on abstract superclass

It’s definitely possible to extract it from Class#getGenericSuperclass() because it’s not defined during runtime, but during compiletime by FooDao extends BaseDao<Foo>. Here’s a kickoff example how you could extract the desired generic super type in the constructor of the abstract class, taking a hierarchy of subclasses into account (along with a real world use case … Read more

Where should “@Transactional” be placed Service Layer or DAO

Ideally, Service layer (Manager) represents your business logic and hence it should be annotated with @Transactional. Service layer may call different DAOs to perform DB operations. Lets assume a situation where you have 3 DAO operations in a service method. If your 1st DAO operation failed, other two may be still passed and you will … Read more

Data access object (DAO) in Java

The Data Access Object is basically an object or an interface that provides access to an underlying database or any other persistence storage. That definition from: http://en.wikipedia.org/wiki/Data_access_object Check also the sequence diagram here: http://www.oracle.com/technetwork/java/dataaccessobject-138824.html Maybe a simple example can help you understand the concept: Let’s say we have an entity to represent an employee: public … Read more