Maven naming conventions for hierarchical multiple module projects

In earlier days with maven I followed the following structure which you have described: appname +— appname-module1 +— appname-module2 +— appname-module2-chhild1 +— appname-module2-chhild2 +— appname-module3 But this will become ridiculous if you get more levels. So I decided to change my mind and now using things like: appname +— module1 +— module2 +— chhild1 +— … Read more

How should a REST URL schema look like for a tree hierarchy?

I’ve noted 2 approaches to RESTful URI design: hierarchical & filtered I feel hierarchical is overly verbose, has the potential for redundant endpoints (not DRY) and disguises in what resource’s state you’re really interested (after all, REST = representational state transfer). I favor Simple URIs Simple is elegant. I’d choose a URI structure like GET … Read more

Eclipse The hierarchy of the type … is inconsistent with @Configurable annotation

In my case, I found the The hierarchy of the type … is inconsistent error in Eclipse being caused by a jar file class from which I was extending my class referencing a class that was not in the build path. So if you have: // in other.dep.jar class FromOtherDepJar {} // in dep.jar class … Read more

How to mix inheritance strategies with JPA annotations and Hibernate?

According to the Hibernate Reference Documentation it should be possible to mix different inheritance mapping strategies when using Hibernate’s XML-Metadata (…) Actually, it’s not really supported, they are “cheating” using a secondary table to switch from the single table strategy in the example of the documentation. Quoting Java Persistence with Hibernate: You can map whole … Read more

How can I list all classes loaded in a specific class loader

Try this. It’s a hackerish solution but it will do. The field classes in any classloader (under Sun’s impl since 1.0) holds hard reference to the classes defined by the loader so they won’t be GC’d. You can take a benefit from via reflection. Field f = ClassLoader.class.getDeclaredField(“classes”); f.setAccessible(true); ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); Vector<Class> classes … Read more

SQL Server: How to get all child records given a parent id in a self referencing table

You can try this DECLARE @Table TABLE( ID INT, ParentID INT, NAME VARCHAR(20) ) INSERT INTO @Table (ID,ParentID,[NAME]) SELECT 1, NULL, ‘A’ INSERT INTO @Table (ID,ParentID,[NAME]) SELECT 2, 1, ‘B-1’ INSERT INTO @Table (ID,ParentID,[NAME]) SELECT 3, 1, ‘B-2’ INSERT INTO @Table (ID,ParentID,[NAME]) SELECT 4, 2, ‘C-1’ INSERT INTO @Table (ID,ParentID,[NAME]) SELECT 5, 2, ‘C-2’ DECLARE … Read more

SQL Server OPENJSON read nested json

Using CROSS APPLY: declare @json nvarchar(max) set @json = ‘ [ { “IdProject”:”97A76363-095D-4FAB-940E-9ED2722DBC47″, “Name”:”Test Project”, “structures”:[ { “IdStructure”:”CB0466F9-662F-412B-956A-7D164B5D358F”, “IdProject”:”97A76363-095D-4FAB-940E-9ED2722DBC47″, “Name”:”Test Structure”, “BaseStructure”:”Base Structure”, “DatabaseSchema”:”dbo”, “properties”:[ { “IdProperty”:”618DC40B-4D04-4BF8-B1E6-12E13DDE86F4″, “IdStructure”:”CB0466F9-662F-412B-956A-7D164B5D358F”, “Name”:”Test Property 2″, “DataType”:1, “Precision”:0, “Scale”:0, “IsNullable”:false, “ObjectName”:”Test Object”, “DefaultType”:1, “DefaultValue”:”” }, { “IdProperty”:”FFF433EC-0BB5-41CD-8A71-B5F09B97C5FC”, “IdStructure”:”CB0466F9-662F-412B-956A-7D164B5D358F”, “Name”:”Test Property 1″, “DataType”:1, “Precision”:0, “Scale”:0, “IsNullable”:false, “ObjectName”:”Test Object”, “DefaultType”:1, “DefaultValue”:”” } … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)